从Mac浏览器发送URL到Prowl(iOS)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了从Mac浏览器发送URL到Prowl(iOS)相关的知识,希望对你有一定的参考价值。

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.
  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

以上是关于从Mac浏览器发送URL到Prowl(iOS)的主要内容,如果未能解决你的问题,请参考以下文章