AppleScript to launch Windows XP in Coherence mode and auto hide the Dock.

Discussion in 'Parallels Desktop for Mac' started by neosublime, Dec 3, 2006.

  1. neosublime

    neosublime Member

    Messages:
    62
    I like to hide the Dock when running XP in coherence mode so I wrote a little script that detects wether Parallels is running or not, then launches, and hides it. Waits for 30 seconds, then hides the Dock, and prings paralles to the front.

    (I use suspend instead of close VM)

    Run it again, and it again, and it quits Parallels and unhides the Dock. Hope it's something you can use.

    Copy the code below, and paste into Apple Script Editor. Save script as an application bundle, and uncheck any checked boxes that are checked. (I put mine in my "Applications" folder.)

    Code:

    Code:
    tell application "System Events"
    	if exists process "Parallels Desktop" then
    		tell application "Parallels Desktop"
    			quit
    		end tell
    		delay 1
    		tell application "System Events"
    			keystroke "d" using {command down, option down}
    		end tell
    		
    	else
    		tell application "Parallels Desktop"
    			activate
    		end tell
    		tell application "System Events"
    			set visible of process "Parallels Desktop" to false
    		end tell
    		delay 30
    		tell application "System Events"
    			keystroke "d" using {command down, option down}
    		end tell
    		tell application "System Events"
    			set visible of process "Parallels Desktop" to true
    		end tell
    		
    	end if
    end tell
    
     

Share This Page