Mailtags yosemite11/30/2023 ![]() ![]() How can you use it? You can download Greg’s Mail Tagging directly (link no longer active: please see note above) or copy the code above and drop it into your script editor. There’s a bit of jiggery-pokery at the end of the script which uses the Finder to figure out where exactly Tagger lives, using its own application ID, just in case you’ve renamed it or placed it somewhere unusual. Once it has the locations for each message, it hooks them all together and hands them off to Tagger using the latter’s command line interface. (In the latter case, tags get wiped out when the file is finally downloaded fully, so it’s no good trying to tag messages before then.) It throws up an error if the message file cannot be found, or if the message hasn’t yet been fully downloaded. The code runs through the set of messages which are currently selected in Mail, grabs the unique ID for each, and then attempts to find the individual file where that message is stored using Spotlight. Set command to quoted form of (POSIX path of appPath) & "/Contents/MacOS/Tagger -f " & msgURL Tell application "Finder" to set appPath to application file id "" as string - grab path using app file ID for Tagger Set myURL to quoted form of (POSIX path of myURL)ĭisplay dialog founderror with title "Whoops!" buttons default button 1 Set founderror to "Spotlight was unable to find a local copy of the selected message." All messages to be tagged must be downloaded fully for tagging to work reliably." Set founderror to "One or more of the selected messages has only been partially downloaded. Set testURL to (do shell script "mdfind -onlyin ~/Library/Mail \"kMDItemFSName = '" & theId & ".partial.emlx'\"") Set myURL to (do shell script "mdfind -onlyin ~/Library/Mail \"kMDItemFSName = '" & theId & ".emlx'\"") So with those in mind, here’s the snippet of AppleScript that acts as ‘glue’: Spotlight can be used to locate the individual file which corresponds to a given message ID pretty quickly.Mail can be used to find the unique ID of any given message, and. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |