• 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: Script to throw away trash in OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to throw away trash in OS X


  • Subject: Re: Script to throw away trash in OS X
  • From: garbanzito <email@hidden>
  • Date: Thu, 21 Feb 2002 11:15:02 -0700

at 2002 02 21, 10:42 -0500, they whom i call Danny Arsenault wrote:
I have read a few posts on throwing away the trash when it says I don't have
the priviledges to do this in OS X. It seems I need to know Unix in order to
do this. Does anyone have a terminal script that would ask me my password
and then empty the trash? Know where I can get one?

here's my solution. the biggest drawback is that the
password must be typed in plain view. this can be solved
with AppleScript Studio, but i haven't gotten that far with
it.

-- empty a single user's home trash folder, overriding privileges
admin_shell("rm -R ~/.Trash/*")

-- execute any shell command with administrator privileges
on admin_shell(the_command)
display dialog "administrator password (text won't be hidden):" default answer ""
do shell script "echo " & text returned of the result & " | sudo -S " & the_command
return the result
end admin_shell



--
steve harley email@hidden
_______________________________________________
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:
    • string literals passwords in run only applications
      • From: Michael Turner <email@hidden>
References: 
 >Script to throw away trash in OS X (From: Danny Arsenault <email@hidden>)

  • Prev by Date: Re: Setting Script Editor Application
  • Next by Date: Re: Type F10 as a user
  • Previous by thread: Script to throw away trash in OS X
  • Next by thread: string literals passwords in run only applications
  • Index(es):
    • Date
    • Thread