I am trying to run a script over my local network that will start a screen sharing session and toggle the dock autohide on the remote machine.
I have come up with this so far, but cant get it to compile.
The remote machine is running 10.5 and the host 10.6
Could somebody point out my mistake?
Thanks in advance,
Badgio
set targetMachine to "vnc://xx:yy@zz.local"
tell application "Screen Sharing"
open location of machine targetMachine
end tell
tell application "System Events" of machine targetMachine
tell dock preferences
set autohide to true
end tell
end tell
Browser: Safari 531.22.7
Operating System: Mac OS X (10.5)
Well, for one you’re using a VNC URL. That won’t work for what you’re asking for.
Remote AppleEvents require an eppc:// URL since that’s the mechanism used for sending AppleScripts over the network. VNC isn’t an issue here - you don’t need to start any kind of screen sharing session to do this.
set targetMachine to "eppc://xx:yy@zz.local"
tell application "System Events" of machine targetMachine
tell dock preferences
set autohide to true
end tell
end tell
The remote machine will need to have Remote Apple Events enabled in is Sharing preferences in order for this to work.