Posted By

Macgeeky on 08/04/10


Tagged

url applescript Firefox title twitter Services automator tjenester echofon


Versions (?)

Firefox - send tittel og url til Echofon


 / Published in: AppleScript
 

URL: http://www.macgeeky.no/send-tittel-og-url-fra-nettleser-til-tweetdec

1) Open Automator (Mac) -> Choose: Service -> Applescript -> paste this script -> save. \r\n\r\n2) Open System preferences -> Keyboard -> Services -> Find the service you just saved in Automator, and dobbel-click at the right side of the name of the service -> Enter an unused keyboard shortcut. \r\n\r\n3) Congrats! Whenever you want to tweet both the title and URL of the webpage (in Firefox) you\'re looking at with Echofon - use the keyboard shortcut you just entered, and the title and URL will be transfered to Echofon. The URL will even be shortened automatickly.

  1. tell application "Firefox"
  2. activate
  3. tell application "System Events" to keystroke "l" using {command down}
  4. tell application "System Events" to keystroke "c" using {command down}
  5. set linken to the clipboard
  6. if the (count of windows) is not 0 then set tittel to name of front window
  7. set tweet to tittel & ": " & linken
  8. set the clipboard to tweet
  9. end tell
  10.  
  11.  
  12. tell application "Echofon"
  13. activate
  14.  
  15. tell application "System Events"
  16.  
  17. key code 120 using control down
  18. delay 0.05
  19. key code 124
  20. delay 0.05
  21. key code 124
  22. delay 0.05
  23. key code 124
  24. delay 0.05
  25. key code 124
  26. delay 0.05
  27. key code 124
  28. delay 0.05
  29. key code 124
  30. delay 0.05
  31. key code 124
  32. delay 0.1
  33. key code 125
  34. key code 125
  35. delay 0.3
  36.  
  37. key code 36
  38.  
  39. end tell
  40. end tell
  41.  
  42. tell application "System Events" to keystroke "n" using {command down}
  43. tell application "System Events" to keystroke "v" using {command down}
  44. tell application "System Events" to keystroke "s" using {command down}

Report this snippet  

You need to login to post a comment.