on run tell application "EyeTV" activate end tell set intTxt to the path to the applications folder as text set intTxt to (intTxt & "EyeTV Scripts:int") set rotateRes to (read file intTxt) RunRotation(rotateRes, intTxt) end run on RunRotation(rotateRes, intTxt) tell application "System Events" if UI elements enabled then tell process "EyeTV" set frontmost to true end tell if rotateRes is "4" then key down {option, command} keystroke "4" key up {option, command} set rotateRes to "1" as text write rotateRes to file intTxt end if if rotateRes is "3" then key down {option, command} keystroke "3" key up {option, command} set rotateRes to "4" as text write rotateRes to file intTxt end if if rotateRes is "2" then key down {option, command} keystroke "2" key up {option, command} set rotateRes to "3" as text write rotateRes to file intTxt end if if rotateRes is "1" then key down {option, command} keystroke "1" key up {option, command} set rotateRes to "2" as text write rotateRes to file intTxt end if else tell application "System Preferences" activate set current pane to pane "com.apple.preference.universalaccess" display dialog "UI element scripting is not enabled. Check 'Enable access for assistive devices'" end tell end if end tell end RunRotation