I am pretty new to applescript… I just tried this:
tell application "DEVONagent"
if not (exists browser 1) then error "No browser windows are open."
set this_browser to browser 1
set u to (URL of this_browser) & ¬
"&title=" & (name of this_browser)
set target_url to "http://del.icio.us/dekay?v=2&url=" & u
open URL target_url
end tell
Why doesn’t the URL open in DevonAgent? When I check the output in ScriptEditor and copy/paste the URL to DA it works, same if I open the URL in Firefox with
tell application "Firefox"
activate
OpenURL target_url
end tell
Is there a way to summarize a web page in DA via AppleScript?
The open URL command requires a correct URL using escapes for non-ascii characters. But this script should work:
tell application "DEVONagent"
if not (exists browser 1) then error "No browser windows are open."
set theParams to do JavaScript "'&url='+escape(document.location)+'&title='+escape(document.title);" in browser 1
open URL "http://del.icio.us/dekay?v=2" & theParams
end tell
try
tell application "DEVONagent"
if not (exists browser 1) then error "No browser windows are open."
set this_browser to browser 1
set this_URL to the URL of this_browser
end tell
tell application "Firefox"
activate
OpenURL this_URL
end tell
end try
Christian, I do have the javascripted & escaped code in my script – which is not working all the time. The other script is just my way to open the current URL in Firefox…