Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save flegfleg/a3c0a8b98b90204e1d1834ef96f217ef to your computer and use it in GitHub Desktop.
Save flegfleg/a3c0a8b98b90204e1d1834ef96f217ef to your computer and use it in GitHub Desktop.
Save Safari selection to new document in Craft.app inbox
tell application "Safari"
set spaceID to "SET YOUR SPACE ID"
set selectedText to (do JavaScript "(''+getSelection())" in document 1)
set docUrl to URL of document 1
set docTitle to name of document 1
set markdownText to "" & selectedText & "" & " - " & docUrl
set crafturl to "craftdocs://createdocument?spaceId=" & spaceID & "&title=" & docTitle & "&content=" & markdownText & "&folderId="
open location crafturl
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment