Skip to content

Instantly share code, notes, and snippets.

View cweirup's full-sized avatar

Chris Weirup cweirup

View GitHub Profile
@cweirup
cweirup / 01_outlook2016_attachment_remover.scpt
Last active January 30, 2019 18:01
The big change from my previous version is that due to Sandboxing, Outlook scripts can no longer write to any directory you choose. So this script now saves to an allowed directory, then puts the directory you want to file to go into the "comments" file attribute. From there, use the Hazel script to read the "comments" attribute and move the fil…
-- The big change from my previous version is that due to Sandboxing,
-- Outlook scripts can no longer write to any directory you choose.
-- So this script now saves to an allowed directory, then puts the
-- directory you want to file to go into the "comments" file attribute.
-- From there, use the Hazel script to read the "comments" attribute
-- and move the file where you want it to go.
use scripting additions
on path2url(thepath)
@cweirup
cweirup / outlook2011_attachment_remover.scpt
Created July 6, 2012 05:48
Outlook 2011 Attachment Remover AppleScript
-- 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)
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
end path2url