Re: system rm from Big Cat
Re: system rm from Big Cat
- Subject: Re: system rm from Big Cat
- From: Alex Robinson <email@hidden>
- Date: Tue, 19 Nov 2002 01:27:20 +0000
>
Any idea why the script below doesn't work when run from Big Cat's
>
contextual menu? It should delete the selected file(s) using the Unix rm
>
command.
I don't know why yours won't work, but why rely on system.osax to carry out
the shell script when you can simply say "do shell script <command>"? And
you can do the shell script with administrator privileges which saves you
all that passwordStr mullarkey.
This works for me:
>
>>>
on main(filelist)
repeat with aFile in filelist
set aFile to aFile as alias
set aPath to posixPath aFile
set cmdStr to "/bin/rm -R " & "\"" & aPath & "\""
do shell script cmdStr with administrator privileges
end repeat
do shell script "sudo -k"
end main
<<<<
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.