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


Click here to return to the 'Use Mail.app without performing pending operations' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use Mail.app without performing pending operations
Authored by: tedw on Nov 29, '09 07:52:00AM
actually, this script will be easier. it just deletes all the offline caches from all your IMAP folders, with no need to fuss about it.
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
	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
	end repeat
end if
copy it into Script Editor and save/run it as you like

[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: lilly333 on Nov 29, '09 07:59:54AM

just did it... started so promising, asking me "delete mail's offline cache?" when i hit "ok" it says: "The Variable thePath is not defined" :(

I guess I have to change something? Put in the path to my IMAP-files? Please advise... thanks!!!!



[ Reply to This | # ]
Use Mail.app without performing pending operations
Authored by: tedw on Nov 29, '09 08:17:28AM
whoops, sorry, forgot a line. should read as follows:
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
	end repeat
end if


[ Reply to This | # ]
Use Mail.app 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.

[code]
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
[/code]



[ Reply to This | # ]