|
|
a better way
from the "Standard Additions Dictionary":
do shell script: execute a shell script or command do shell script plain text -- the command or shell script to execute. Examples are ‘ls' or ‘/bin/ps -auxwww' [administrator privileges boolean] -- execute the command as the administrator [password plain text] -- use this administrator password to avoid a password dialog [Result: plain text] -- the command output if you notice you can leave out the password and you will be prompted for an administrator password. so with that information we can make some slight changes to the script, with no stored password.
display dialog "Empty Trash as root?" buttons ¬
{"Cancel", "TRASH"} default button "TRASH" with icon note
set the user_choice to the button returned of the result
if the user_choice is "Trash" then
display dialog "ARE YOU SURE?" buttons {"NO", "YES"} ¬
default button "NO" with icon note
set the user_choice to the button returned of the result
end if
if the user_choice is "Yes" then
do shell script ¬
"rm -rf /.Trashes/* ~/.Trashes/* ~/.Trash/*" ¬
with administrator privileges
--"/Volumes/*/.Trashes/*"
end if
a better way
thanks mkoz! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|