Hi Jacque,

Couple questions. Have you tried running the command from Terminal? If so, does it work okay there? Also, have you tried running it from the AppleScript script editor? If it fails there, you might get a more descriptive error message.

One thing that I'm doing different is instead of putting the entire command into a variable, I'm only putting in the actual shell script part. So my code would read something like:

do "do shell script" && quote & tCmd & quote && "with administrator privileges"

I don't know if that makes a difference or not. It shouldn't, but it is working for me just fine. Granted, I am only changing permissions on a single file, not on a folder.

Just a couple ideas. Sorry I can't really provide more concrete help.

Chris


On Jan 18, 2007, at 11:13 AM, J. Landman Gay wrote:

sims wrote:
At 8:48 PM -0800 1/17/07, Richard Gaskin wrote:
You mean Apple provides no way for any scripting language to request authorization on its own? Not even AppleScript?
For the dialog use AppleScript:
do shell script "command" with administrator privileges
To pass other items use:
do shell script "command" user name "me" password "mypassword" with administrator privileges

I'm having trouble with this. I do get the official Apple password dialog, but can't execute a command.

I want to change permissions on a folder. This script fails with "execution error":

put "chmod 777 /Library/Application Support/myfolder/" into tShellCmd
put "do shell script" &&quote& tShellCmd &quote&& "with administrator privileges" into tCmd
  do tCmd as applescript
  put the result

So I figured I needed to escape the space. When I do that, this script fails with "compiler error":

put "chmod 777 /Library/Application\ Support/myfolder/" into tShellCmd
put "do shell script" &&quote& tShellCmd &quote&& "with administrator privileges" into tCmd
  do tCmd as applescript
  put the result

If I substitute colons instead of slashes I go back to "execution error". Adding "sudo" to the front of the command doesn't help (but I'm running as admin right now, so maybe that's why.)

What's the right command to allow any user, admin or not, to type in an admin password and set the permissions on this folder? Am I using this feature correctly?

--
Jacqueline Landman Gay         |     [EMAIL PROTECTED]
HyperActive Software           |     http://www.hyperactivesw.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------


_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to