Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Lounge Deluxe

macrumors regular
Original poster
Jun 1, 2009
157
26
Amsterdam
Hi, I want my macbook Pro to automatically start a VNC connection with my Mac Mini upon login. However I cannot find a way to automate it.

If I manually enter vnc://user name : password@Mac-Mini.local/ through "connect to server" in Finder (or command-k) then Screen Sharring.app automatically starts (which is exactly what I want), however I want to automate this when I login to my Macbook Pro (or restart).

I tried to 'build' an Automator app by taking the command "Get Specified Server" and entering vnc://user name : password@Mac-Mini.local/ (with the proper name and password of course and without the spaces before and after the : sign--this creates an unintended smilie though in this forum so I entered spaces :) ) and then adding the command "connect to server". I get an error saying it can't open vmc (only smb/afp etc).

Can someone help out how I can automate this? Thanks!
 
create an applescript with following

Code:
do shell script "open vnc://username:password@theLocalMac"

save it as an app rather than a script

go to settings users and groups

select your account from the items on the left handside

with your account selected click the login items button on the main right hand part of the window

hit the add button just below the list of current login items

browse to where you saved the app and add it to the list


dependingon how quick you establish a network connection after login you might need to play around with the script a little to add a short delay before machine tries to establish the screen share

e.g

Code:
delay 10
do shell script "open vnc://username:password@theLocalMac"

to wait 10 seconds before trying to establish a connection
 
Thanks a lot snorkelman, your script saved as an app works perfectly! I had to use a delay of 20 secs btw. Much appreciated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.