AVS Forum banner
  • Our native mobile app has a new name: Fora Communities. Learn more.

MAC 101: script files / startup ?

517 Views 2 Replies 2 Participants Last post by  JackLT
Quick question for those with MAC knowledge.


I've setup a Synergy server on the PC and a client on the MAC to share keyboards and mice. Works great!


On the MAC to start the client app I have to ...

open a terminal window

cd to the synergy directory

then ./synergyc 192.168.0.10


What would a script look like to do the same?

and how could I create a icon for it ?

How could I have the script run on startup as well?


Thanks!
Status
Not open for further replies.
1 - 3 of 3 Posts
There are a number of ways of doing this, a simple solution would be to write an applescript (Using Script Editor, in the Applescript folder in the Applications folder) that sent the shell commands for you, it could be as simple as:


do shell script "/Applications/synergyc 192.168.0.10"

(or if you have to background it to keep it from exiting immediately :

do shell script "/Applications/synergyc 192.168.0.10 &")


or depending on circumstance:


do shell script "cd /Applications/synergyc;./synergyc 192.168.0.10"


or could run a full script that you have written.


Then save the script as "Application". This will make a double-clickable application. Now that you have an application, you can drop that into the startup items in the Accounts section of System Preferences.


Hope this helps. There are other approaches, but I think this one is fairly simple to implement.


-khill


(reference: http://developer.apple.com/technotes/tn2002/tn2065.html )



As for the icon (keeping in the spirit of simplicity) you can change any icon by copying the new image you want to the clipboard (say, from preview, Edit:Copy). Then click on the file / folder / whatever in the finder and select File:Get Info. You can then click on the icon in at the top of the info display and select paste. This isn't a real icon of course, with variable sizes / masks, but it is good enough for most purposes.
See less See more
Thanks works perfect, the apple script tool looks interesting as well.

I'm sure I'll find other uses for it!
1 - 3 of 3 Posts
Status
Not open for further replies.
Top