Skip to content

Instantly share code, notes, and snippets.

@jbonhag
Created December 12, 2017 22:39
Show Gist options
  • Save jbonhag/95902917534c41daad38ea9241e5ff1a to your computer and use it in GitHub Desktop.
Save jbonhag/95902917534c41daad38ea9241e5ff1a to your computer and use it in GitHub Desktop.
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