Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Run shell scripts from the Script Menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Run shell scripts from the Script Menu
Authored by: cj on Apr 23, '03 12:54:40PM

It appears that ScriptMenu.menu has an issue with paths
that have spaces in them. After upgrading to 10.2, I
noticed that my shell scripts no longer worked from the
script menu -- didn't spend any time on fixing them until I
saw this hint today. As it turns out, I was getting "No such
file or directory" errors truncated at the first space in the
path; replacing the spaces in the paths with underscores
fixed the problem. This didn't happen with 10.1's Script
Menu, so I'll be sending this bug to Apple, but I thought
I'd post it here in case anyone else was experiencing this
issue.



[ Reply to This | # ]
Run shell scripts from the Script Menu
Authored by: webdog on Apr 23, '03 01:10:27PM

Is there any way to have the system perform "root" level scripts
without being logged in as "root"? It would be great to have a
script that could perform a graceful restart of apache from the
finder, for example.



[ Reply to This | # ]
Run shell scripts from the Script Menu
Authored by: googoo on Apr 23, '03 04:05:53PM

You could write a little applescript interface with

do shell script "path/to/script" with administrator privileges

You will be prompted for your password, and then the script will execute as root. You may want to redirect the stdout and stderr to a file so that you can see what happened.

-Mark



[ Reply to This | # ]
Run shell scripts from the Script Menu
Authored by: wilseven on Apr 23, '03 01:18:23PM

one thing people might want to check out is the fastScripts
program from red-sweater, which is basically the same as the
script menu but takes multiple script locations into account and
has some other feature.

http://www.red-sweater.com/RedSweater/FSFeatures.html

You can run shell scripts from this. As far as running as root,
couldn't you just sudo? If not, how about the applescript
command 'do shell script'?

http://developer.apple.com/technotes/tn2002/tn2065.html



[ Reply to This | # ]