Last active
December 24, 2015 17:24
-
-
Save nrollr/7edd972fd76c9a913789 to your computer and use it in GitHub Desktop.
Applescript to backup Thunderbird directory as .zip File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copy Thunderbird directory to /Users/{username}/Temp/ | |
set mailFolder to ((path to home folder) as text) & "Library:Thunderbird" as alias | |
set tempFolder to ((path to home folder) as text) & "Temp" as alias | |
tell application "Finder" | |
duplicate folder mailFolder to folder tempFolder with replacing | |
end tell | |
-- Compress the Thunderbird copy | |
set destinationFolder to ((path to home folder) as text) & "Temp" as alias | |
set sourceFolder to ((path to home folder) as text) & "Temp:Thunderbird" as alias | |
set dateStamp to short date string of (get current date) | |
set zipFile to (POSIX path of (destinationFolder) & "Mail_" & dateStamp & ".zip") | |
set zipFolder to (POSIX path of (sourceFolder)) | |
tell current application | |
do shell script "zip -r " & zipFile & " " & zipFolder & "" | |
end tell | |
-- Remove the Thunderbird copy | |
tell application "Finder" | |
delete folder sourceFolder | |
end tell | |
display notification "Thunderbird: backup successful!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment