Last active
December 28, 2016 01:54
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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