How do I set up a shell script to execute from the Mac OSX dock? It seems that simply creating a shortcut will open the file in my editor. Is there a flag I need to set som
As joe mentioned, creating the shell script and then creating an applescript script to call the shell script, will accomplish this, and is quite handy.
Create your shell script in your favorite text editor, for example:
mono "/Volumes/Media/~Users/me/Software/keepass/keepass.exe"
(this runs the w32 executable, using the mono framework)
Save shell script, for my example "StartKeepass.sh"
Open AppleScript Editor, and call the shell script
do shell script "sh /Volumes/Media/~Users/me/Software/StartKeepass.sh" user name "
do shell script
- applescript command to call external shell commands"sh ...."
- this is your shell script (full path) created in step one (you can also run direct commands, I could omit the shell script and just run my mono command here)user name
- declares to applescript you want to run the command as a specific user"
- replace with your username (keeping quotes) ex "josh"password
- declares to applescript your password""
- replace with your password (keeping quotes) ex "mypass"with administrative privileges
- declares you want to run as an adminsave your applescript as filename.scpt, in my case RunKeepass.scpt
save as... your applescript and change the file format to application, resulting in RunKeepass.app in my case
Copy your app file to your apps folder