Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2006



Tip: Looking for answers? Try searching our database.

Applescript waiting for front row to quit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mattias  Johansson - 31 Oct 2006 19:14 GMT
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>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.