Guest User

Untitled

a guest
Sep 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. on alfred_script(q)
  2. set theURL to ""
  3. set pageName to ""
  4. tell application "Google Chrome"
  5. set theURL to URL of active tab of window 1
  6. set pageName to title of active tab of window 1
  7. end tell
  8. tell application "Safari"
  9. if not (exists (document 1)) then
  10. tell application "Safari" to activate
  11. make new document
  12. end if
  13. end tell
  14. tell application "Safari"
  15. set shortLink to "alfredapp://customsearch/" & pageName & "/" & q & "/ascii/url=" & theURL
  16. set URL of current tab of window 1 to shortLink
  17. activate
  18. end tell
  19. end alfred_script
Add Comment
Please, Sign In to add comment