• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: system rm from Big Cat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: system rm from Big Cat
      • From: Michael Grant <email@hidden>
References: 
 >system rm from Big Cat (From: Michael Grant <email@hidden>)

  • Prev by Date: Re: getting headers from Mail
  • Next by Date: Re: Launch Default Mail App attached the file
  • Previous by thread: system rm from Big Cat
  • Next by thread: Re: system rm from Big Cat
  • Index(es):
    • Date
    • Thread