Send URL from Mac browser

Submitted by:Jhon Brain

Date added:05 December, 2013

Category:ActionScript

AppleScript to send URL from Mac browser to Prowl (iOS)

Tags: send url

Code Snippet:

on run {input, parameters}

tell application "System Events" to set FrontAppName to name of first process where frontmost is true
if FrontAppName is "Firefox-bin" then
tell application "Firefox"
activate
tell application "System Events" to keystroke "l" using {command down}
tell application "System Events" to keystroke "c" using {command down}
set linken to (the clipboard)
end tell
else if FrontAppName is "Google Chrome" then

tell application "Google Chrome"
activate
tell application "System Events" to keystroke "l" using {command down}
tell application "System Events" to keystroke "c" using {command down}
set linken to (the clipboard)

end tell

else if FrontAppName is "Safari" then

tell application "Safari"
set linken to (set the clipboard to ((get URL of document 1) as string))
end tell

else if FrontAppName is "Opera" then

tell application "Opera"
set linken to (set the clipboard to (get URL of front window))
end tell

end if

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

return input
end run
 
 

Comments