Skip to content

Instantly share code, notes, and snippets.

@yoko
Created April 17, 2013 08:08
Show Gist options
  • Save yoko/5402580 to your computer and use it in GitHub Desktop.
Save yoko/5402580 to your computer and use it in GitHub Desktop.
on run {input, parameters}
tell application "System Events"
set front_app to name of (path to frontmost application)
end tell
set page_url to false
if front_app is "Safari.app" then
tell application "Safari"
if windows is not equal to {} then
set page_url to URL of current tab of window 1
set page_title to name of current tab of window 1
end if
end tell
end if
if front_app is "Google Chrome.app" then
tell application "Google Chrome"
if windows is not equal to {} then
set page_url to URL of active tab of window 1
set page_title to title of active tab of window 1
end if
end tell
end if
tell application "Things"
if page_url is not false then
set props to {name:input, notes:page_title & "
" & page_url}
else
set props to {name:input}
end if
show quick entry panel with properties props
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment