Recent Changes - Search:

Homekoti

Tuomas Rosberg

pmwiki.org

edit SideBar

Mac /

TV-rutiinit

 (*
 TV routines
 Tuomas Rosberg 2009
 A script running in the backround to ensure the most comfortable TV watching experience:
 Runs EyeTV. Runs display backlight settings (freeware "Shades").
 When EyeTV is the frontmost app, and live TV is on, enters full screen. 
 Save the script as an application, with "Stay open" checked.
 Set it to run at login if you have a dedicated TV Mac.
 *)

 global appPath
 ---------
 on run
   set appPath to path to application "EyeTV"
   -- After some Mac OS X 10.5 minor update, "Shades" stopped to run at login.
   -- To restore functionality, toggle the "Shades" preference pane: 
   tell application "System Preferences"
   	activate
   	reveal pane "Shades"
   	tell application "System Events"
   		if UI elements enabled then
   			tell process "System Preferences"
   				tell window "Shades Preferences"
   					click button 4
   				end tell
   			end tell
   		else -- nothing. 
   		end if
   	end tell
   end tell
   tell application "EyeTV"
   	activate
   end tell
 end run 
 ---------- 
 on idle
   set p to path to frontmost application
   if p is (path to me) then
   	display dialog "Do you want to toggle preference pane \"Shades\"?" buttons {"Cancel", "OK"} default button "OK"
   	if button returned of result is "OK" then
   		run me
   	else -- do nothing
   	end if
   else if p is appPath then
   	my setFullScreen()
   end if
   return 6 -- seconds to idle
 end idle
 --------
 on setFullScreen()
   try
   	tell application "EyeTV"
   		if playing is true then -- There is a video window
   			if full screen is false then -- The video window is not full screen
   				enter full screen
   			end if
   		end if
   	end tell
   on error -- do nothing
   end try
 end setFullScreen
Edit - History - Print - Recent Changes - Search
Page last modified on 14.02.2010, 05:52