Skip to content

Instantly share code, notes, and snippets.

@giratikanon
Created April 5, 2012 05:25
Show Gist options
  • Save giratikanon/2308213 to your computer and use it in GitHub Desktop.
Save giratikanon/2308213 to your computer and use it in GitHub Desktop.
Save a Chrome page as a keyworded custom search in Alfred
on alfred_script(q)
set theURL to ""
set pageName to ""
tell application "Google Chrome"
set theURL to URL of active tab of window 1
set pageName to title of active tab of window 1
end tell
tell application "Safari"
if not (exists (document 1)) then
tell application "Safari" to activate
make new document
end if
end tell
tell application "Safari"
set shortLink to "alfredapp://customsearch/" & pageName & "/" & q & "/ascii/url=" & theURL
set URL of current tab of window 1 to shortLink
activate
end tell
end alfred_script
@giratikanon
Copy link
Author

Like cutting a sandwich with a chainsaw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment