Hello, everyone!
I'm a newbie to mac and I'm just learning applescript. I'm currently
writing a script to activate monitor duplication in system preferences,
launching front row, and then changing it back. The part I'm having
trouble with is getting the script to wait until front row exits until
it continues. Can anyone help?
This is how it looks:
tell application "Finder"
open document file "Displays.prefPane" of folder "PreferencePanes" of
folder "Library" of folder "System" of startup disk
delay 1.5
end tell
tell application "System Events"
tell process "System Preferences"
tell window "iMac"
tell tab group 1
click radio button "Uppställning"
end tell
end tell
end tell
end tell
tell application "System Events"
tell process "System Preferences"
tell window "iMac"
tell tab group 1
tell group 1
click checkbox "Skärmbildsdubblering"
end tell
end tell
end tell
end tell
end tell
tell application "System Events"
tell application "Front Row" to activate
key code 53 using {command down}
delay 0.5
key code 53
end tell
-----------
DONT CONTINUE FURTHER UNTIL FRONT ROW EXISTS
-----------
tell application "Finder"
open document file "Displays.prefPane" of folder "PreferencePanes" of
folder "Library" of folder "System" of startup disk
delay 1.5
end tell
tell application "System Events"
tell process "System Preferences"
tell window "iMac"
tell tab group 1
click radio button "Uppställning"
end tell
end tell
end tell
end tell
tell application "System Events"
tell process "System Preferences"
tell window "iMac"
tell tab group 1
tell group 1
click checkbox "Skärmbildsdubblering"
end tell
end tell
end tell
end tell
end tell
Patrick Stadelmann - 31 Oct 2006 19:56 GMT
> I'm a newbie to mac and I'm just learning applescript. I'm currently
> writing a script to activate monitor duplication in system preferences,
> launching front row, and then changing it back. The part I'm having
> trouble with is getting the script to wait until front row exits until
> it continues. Can anyone help?
set frontRowRunning to true
repeat until frontRowRunning = false
tell application "System Events"
set frontRowRunning to (application process "Front Row" exists)
delay 1
end tell
end repeat
Patrick

Signature
Patrick Stadelmann <Patrick.Stadelmann@unine.ch>