Skip to content

Instantly share code, notes, and snippets.

@marmot401
marmot401 / outlook2011_attachment_remover.scpt
Created August 1, 2013 02:15
modified apple script, https://gist.github.com/cweirup/3058303 7/31/13 updated the script so that running the script on multiple emails does not cause the attachment list to grow.
-- AppleScript to remove attachment from selected messages in Outlook 2011
-- Incorporates code from these sources:
-- http://dice.neko-san.net/2012/03/strip-attachments-from-outlook-2011-using-applescript/
-- http://stackoverflow.com/questions/9617029/how-to-get-the-a-file-url-in-osx-with-applescript-or-a-shell-script (for path2url function)
-- https://gist.github.com/cweirup/3058303
-- 7/31/13 updated the script so that running the script on multiple emails does not cause the attachment list to grow. Moved "repeat with theMessage in selectedMessages" to a better place
on path2url(thepath)
-- Needed to properly URL encode the path
return do shell script "python -c \"import urllib, sys; print (urllib.quote(sys.argv[1]))\" " & quoted form of thepath