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: lilly333 on Nov 29, '09 12:12:00AM

Thanks tedw! how do I go about it? I've looked at your link but I don't understand even the basics... how do I I quit finde?? Where do I put this script and/or how do I implement it?

Or: what should I write into the Terminal window? Where can I find the commands that show me the hidden files? I know it's a lot of questions... I reaslly appreciate your help!



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

open the Script Editor application (/Applications/AppleScript/Script Editor.app), copy the script from the link (everything in red) into the editor, and save it. You can run it straight from the script editor, run it from the script menu or quicksilver or some such, or save it as an application and ad double-click it.

it will do everything for you. play with it a bit and you'll see how it works.



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

thnaks tedw, I've just tried what you wrote (opened the script editor, copy+paste the red text - your script, than I saved it and hit the "run"-button. All I get is: "AppleScript Error: Specified button does not exist" ... sorry, I feel really stupid - what is it that I'm doing wrong?



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

yeah, apparently that's an error in that guy's script (he wrote 'default button 3' when there are only two buttons). but try the script I just wrote, which deletes the file directly without turning hidden files on or off.

Edited on Nov 29, '09 07:58:35AM by tedw



[ Reply to This | # ]
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 | # ]