Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Use without performing pending operations' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use without performing pending operations
Authored by: Wild_Eep on Aug 09, '10 02:09:58PM

I found that I had to add 'with administrator privileges' to the end of the 'do shell script' line in order for the script to run without throwing a permissions error. The script asks for an administrator's user/pass, but then runs properly.

display dialog "Delete Mail's offline caches?" buttons {"Cancel", "Delete"} default button 2
copy the result as list to {buttonpressed}

if the buttonpressed is "Delete" then
set thePath to (path to library folder from user domain as text) & "Mail"
tell application "Finder"
set theIMAPFolders to (every folder of folder thePath whose name begins with "IMAP") as alias list
end tell
repeat with thisFolder in theIMAPFolders
set theCachePath to (POSIX path of thisFolder & ".OfflineCache")
do shell script "rm -rf " & theCachePath with administrator privileges
end repeat
end if

[ Reply to This | # ]