Send URL from Mac browser to Prowl (iOS)


/ Published in: AppleScript
Save to your folder(s)

Use this script in Automator, and make a Service of it. Then give the service a shortcut in System Preferences -> Keyboard

In the script you have to switch the "SETT_INN_API-KODE_FRA_PROWL_HER" with a Prowl API code (https://www.prowlapp.com/api_settings.php). Prowl must be installed on iPhone too.


Copy this code and paste it in your HTML
  1. on run {input, parameters}
  2.  
  3.  
  4.  
  5. tell application "System Events" to set FrontAppName to name of first process where frontmost is true
  6.  
  7. if FrontAppName is "Firefox-bin" then
  8.  
  9. tell application "Firefox"
  10. activate
  11. tell application "System Events" to keystroke "l" using {command down}
  12. tell application "System Events" to keystroke "c" using {command down}
  13.  
  14. set linken to (the clipboard)
  15.  
  16. end tell
  17.  
  18. else if FrontAppName is "Google Chrome" then
  19.  
  20. tell application "Google Chrome"
  21. activate
  22. tell application "System Events" to keystroke "l" using {command down}
  23. tell application "System Events" to keystroke "c" using {command down}
  24. set linken to (the clipboard)
  25.  
  26.  
  27.  
  28. end tell
  29.  
  30. else if FrontAppName is "Safari" then
  31.  
  32. tell application "Safari"
  33. set linken to (set the clipboard to ((get URL of document 1) as string))
  34. end tell
  35.  
  36. else if FrontAppName is "Opera" then
  37.  
  38. tell application "Opera"
  39. set linken to (set the clipboard to (get URL of front window))
  40. end tell
  41.  
  42.  
  43.  
  44. end if
  45.  
  46. do shell script "curl -s -k https://prowl.weks.net/publicapi/add -F apikey=SETT_INN_API-KODE_FRA_PROWL_HER -F application=" & FrontAppName & " -F description=" & linken
  47.  
  48. return input
  49. end run

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.