Skip to content

Instantly share code, notes, and snippets.

@kerim
Last active December 28, 2016 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerim/b5a56ca19ca2d1c4c4d3a050aa0d00c2 to your computer and use it in GitHub Desktop.
Save kerim/b5a56ca19ca2d1c4c4d3a050aa0d00c2 to your computer and use it in GitHub Desktop.
Run External AppleScript to Get Name of Downloaded OPML outline file from first entry (using TextWrangler and passing to Hazel)
hazelProcessFile(theFile)
on hazelProcessFile(theFile)
tell application "TextWrangler"
open theFile
tell application "TextWrangler"
set theFindResult to find "<outline text=\"(.*)\" >" searching in text document 1 options {search mode:grep, starting at top:true}
if found of theFindResult then
set theFileName to grep substitution of "\\1"
return {hazelOutputAttributes:{theFileName}}
end if
end tell
end tell
end hazelProcessFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment