Re: Script to throw away trash in OS X
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.