tell application "Mail" set theId to id of item 1 of (selection as list) set theEmail to (do shell script "mdfind -onlyin ~/Library/Mail \"kMDItemFSName = '" & theId & ".emlx'\"") set defaultName to subject of item 1 of (selection as list) repeat set savePath to choose folder with prompt "Save archive mail to:" default location path to home folder set the saveLocation to (savePath as string) if savePath is not "" then exit repeat end repeat repeat display dialog "Set archive name as:" default answer defaultName buttons {"Cancel", "OK"} default button 2 set the archiveName to the text returned of the result & ".emlx" if the archiveName is not "" then exit repeat end repeat end tell do shell script "cp '" & theEmail & "' '" & POSIX path of saveLocation & "'; cd '" & POSIX path of saveLocation & "'; mv '" & theId & "" & ".emlx" & "' '" & archiveName & "'" beep