Skip to content

Instantly share code, notes, and snippets.

@reid
Created January 21, 2011 22:33
Show Gist options
  • Save reid/790560 to your computer and use it in GitHub Desktop.
Save reid/790560 to your computer and use it in GitHub Desktop.
Send current Safari selection or web page to TaskPaper
tell application "Safari"
tell front document
set theURL to URL
set theName to (do JavaScript "(getSelection())")
if length of theName is equal to 0 then set theName to name
end tell
end tell
tell application "TaskPaper"
tell front document
tell project named "Inbox"
set newEntry to make new entry with properties {entry type:task type, text content:theName}
tell newEntry
make new entry with properties {entry type:note type, text content:"From: " & theURL}
end tell
end tell
end tell
end tell
(* Copyleft 2011 Reid Burke, no rights reserved. *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment