Created
April 5, 2012 05:25
-
-
Save giratikanon/2308213 to your computer and use it in GitHub Desktop.
Save a Chrome page as a keyworded custom search in Alfred
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like cutting a sandwich with a chainsaw.