Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Hardware > Apple TV and Home Theater

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 3, 2011, 06:59 PM   #1
adamfishercox
macrumors 6502
 
Join Date: Aug 2007
Help an AppleScript noob!

I'm using AppleScripts and RemoteBuddy to manage Plex, Hulu Desktop, EyeTV, and Boxee on my Mac TV setup. I'm by no means a pro at AppleScript so I'd hope I could get some help here.

The goal is for the script to close whichever app is open, launch Boxee, and tab over to "Apps" and hit enter so that basically the button that I assign this script to will take me straight to the app screen. This works great for everything except Hulu Desktop. That section of the script just won't send the keystrokes. I've tried putting in delays everywhere and even had it send the keystrokes over and over just to test and it just won't send them. Any help?

Code:
tell application "System Events"
	if exists process "EyeTV" then
		tell application "Boxee" to launch
		tell application "EyeTV" to close every window
		tell application "Boxee" to activate
	end if
	if exists process "Hulu Desktop" then
		tell application "Boxee" to launch
		tell application "Boxee" to activate
		tell application "System Events" to key code 124
		tell application "System Events" to key code 124
		tell application "System Events" to key code 36
		tell application "System Events" to key code 124
		delay 1
		tell application "Hulu Desktop" to quit
	end if
	if exists process "Plex" then
		tell application "Plex" to quit
		tell application "Boxee" to launch
		tell application "Boxee" to activate
		delay 1
	end if
end tell
tell application "Boxee" to activate
tell application "System Events" to key code 124
tell application "System Events" to key code 124
tell application "System Events" to key code 36
tell application "System Events" to key code 124
__________________
Web, Icon and UI Designer adamfishercox.com
adamfishercox is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Hardware > Apple TV and Home Theater

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Programming 0 Oct 28, 2013 11:38 PM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Applications and Mac App Store 0 Oct 28, 2013 11:32 PM
Handbrake Noob: Help ZmyDust Mac Applications and Mac App Store 6 Feb 17, 2013 10:54 PM
Noob questions Sergiy iPhone/iPad Programming 26 Nov 1, 2012 10:53 PM
Sorry - another noob... tallbutslow MacBook Air 1 Jun 14, 2012 05:53 PM

Forum Jump

All times are GMT -5. The time now is 04:20 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC