Created
December 12, 2017 22:39
-
-
Save jbonhag/95902917534c41daad38ea9241e5ff1a to your computer and use it in GitHub Desktop.
This file contains 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
to getDocumentName() | |
tell application "Safari" | |
return name of document 1 as text | |
end tell | |
end getDocumentName | |
to getDocumentBody() | |
tell application "Safari" | |
return source of document 1 as text | |
end tell | |
end getDocumentBody | |
to createNote(documentUrl) | |
tell application "Safari" | |
set URL of document 1 to documentUrl | |
delay 5 | |
end tell | |
set documentName to getDocumentName() | |
set documentBody to getDocumentBody() | |
tell application "Notes" | |
make new note at folder "Notes" with properties {name:documentName, body:documentBody} | |
end tell | |
end createNote | |
on run argv | |
repeat with arg in argv | |
createNote(arg) | |
end repeat | |
end run | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment