AMApplicationBuild 527 AMApplicationVersion 2.10 AMDocumentVersion 2 actions action AMAccepts Container List Optional Types com.apple.mail.message-object com.apple.mail.mailbox-object com.apple.mail.account-object AMActionVersion 2.0.2 AMApplication Mail AMParameterProperties itemType AMProvides Container List Types com.apple.mail.message-object com.apple.mail.mailbox-object com.apple.mail.account-object AMRequiredResources AMSelectedInputType com.apple.mail.message-object AMSelectedOutputType com.apple.mail.message-object ActionBundlePath /System/Library/Automator/Get Selected Mail Items 2.action ActionName Get Selected Mail Messages ActionParameters itemType com.apple.mail.message-object BundleIdentifier com.apple.Automator.GetSelectedMailItems2 CFBundleVersion 2.0.2 CanShowSelectedItemsWhenRun CanShowWhenRun Category AMCategoryMail Class Name Get_Selected_Mail_Items_2 InputUUID CCB6B7CA-4C89-498F-8F9F-A51DE1B88126 Keywords OutputUUID 39CD84E9-293C-49AB-B17E-EC8137CB5858 UUID 4700525B-4558-4EEE-AAB6-1F6AA3CAB8AB UnlocalizedApplications Mail arguments 0 default value com.apple.mail.message-object name itemType required 0 type 0 uuid 0 isViewVisible 1 location 565.000000:225.000000 nibPath /System/Library/Automator/Get Selected Mail Items 2.action/Contents/Resources/Base.lproj/main.nib isViewVisible 1 action AMAccepts Container List Optional Types com.apple.applescript.object AMActionVersion 1.0.2 AMApplication Automator AMParameterProperties source AMProvides Container List Types com.apple.applescript.object ActionBundlePath /System/Library/Automator/Run AppleScript.action ActionName Run AppleScript ActionParameters source tell application "Mail" set selectedMessages to selection -- Ask for the save location once set savePath to (choose folder) as rich text -- Initialize counter set messageCount to 0 repeat with theMessage in selectedMessages set messageId to message id of theMessage set messageSubject to subject of theMessage -- Clean up the subject for use in a filename set cleanSubject to my cleanupFileName(messageSubject) set saveFile to savePath & cleanSubject & ".eml" set messageContent to content of theMessage my saveTextToFile(messageContent, saveFile) -- Delete the message after saving delete theMessage -- Increment counter set messageCount to messageCount + 1 end repeat -- Return the count for use in the notification return messageCount end tell on cleanupFileName(theText) -- Replace characters not allowed in filenames set disallowedChars to {":", "/", "\\", "*", "?", "\"", "<", ">", "|"} repeat with badChar in disallowedChars set theText to my replaceText(theText, badChar, "-") end repeat return theText end cleanupFileName on replaceText(theText, oldItem, newItem) set AppleScript's text item delimiters to oldItem set tempText to text items of theText set AppleScript's text item delimiters to newItem set theText to tempText as text set AppleScript's text item delimiters to "" return theText end replaceText on saveTextToFile(theText, filePath) set fileRef to open for access filePath with write permission write theText to fileRef close access fileRef end saveTextToFile BundleIdentifier com.apple.Automator.RunScript CFBundleVersion 1.0.2 CanShowSelectedItemsWhenRun CanShowWhenRun Category AMCategoryUtilities Class Name RunScriptAction InputUUID 183F4AB1-A26C-4B59-813F-2ABF3669FB67 Keywords Run OutputUUID A39F2355-3FC6-4DBC-8E97-2E5FD14119CD UUID BCAB5567-33BB-40E5-A2E3-0649FF5985A1 UnlocalizedApplications Automator arguments 0 default value on run {input, parameters} (* Your script goes here *) return input end run name source required 0 type 0 uuid 0 isViewVisible 1 location 565.000000:470.000000 nibPath /System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib isViewVisible 1 action AMAccepts Container List Optional Types AMActionVersion 1.0 AMApplication Automator AMParameterProperties message tokenizedValue subtitle tokenizedValue Operation Complete title tokenizedValue Email Workflow Finished! AMProvides Container List Types ActionBundlePath /System/Library/Automator/Display Notification.action ActionName Display Notification ActionParameters message subtitle Operation Complete title Email Workflow Finished! BundleIdentifier com.apple.Automator.Display-Notification CFBundleVersion 1.0 CanShowSelectedItemsWhenRun CanShowWhenRun Category AMCategoryUtilities Class Name AMDisplayNotificationAction InputUUID 6CAADB58-8B65-4F02-B14F-3AAC1B915D86 Keywords OutputUUID EB893C3D-3F0F-4578-97A3-0F608B8AD4A7 UUID 696BEC53-BED6-4EB2-81BF-EAC6FAC9D2B0 UnlocalizedApplications Automator arguments 0 default value name message required 0 type 0 uuid 0 1 default value name subtitle required 0 type 0 uuid 1 2 default value name title required 0 type 0 uuid 2 isViewVisible 1 location 565.000000:659.000000 nibPath /System/Library/Automator/Display Notification.action/Contents/Resources/Base.lproj/main.nib isViewVisible 1 connectors 6905121F-34E7-40C8-B5B5-2F10D6B54A16 from 4700525B-4558-4EEE-AAB6-1F6AA3CAB8AB - 4700525B-4558-4EEE-AAB6-1F6AA3CAB8AB to BCAB5567-33BB-40E5-A2E3-0649FF5985A1 - BCAB5567-33BB-40E5-A2E3-0649FF5985A1 B9A4ABA7-7A9F-4F9E-AB52-97BD171DF4D0 from BCAB5567-33BB-40E5-A2E3-0649FF5985A1 - BCAB5567-33BB-40E5-A2E3-0649FF5985A1 to 696BEC53-BED6-4EB2-81BF-EAC6FAC9D2B0 - 696BEC53-BED6-4EB2-81BF-EAC6FAC9D2B0 workflowMetaData applicationBundleID com.apple.mail applicationBundleIDsByPath /System/Applications/Mail.app com.apple.mail applicationPath /System/Applications/Mail.app applicationPaths /System/Applications/Mail.app inputTypeIdentifier com.apple.Automator.nothing outputTypeIdentifier com.apple.Automator.nothing presentationMode 11 processesInput serviceApplicationBundleID com.apple.mail serviceApplicationPath /System/Applications/Mail.app serviceInputTypeIdentifier com.apple.Automator.nothing serviceOutputTypeIdentifier com.apple.Automator.nothing serviceProcessesInput systemImageName NSTouchBarMail useAutomaticInputType workflowTypeIdentifier com.apple.Automator.servicesMenu