I like to search for audiobook titles across my public library and other resources, like Audible.com. I currently use an Applescript action via Launchbar to open the same search across several sites, in several tabs in the same Safari window. Now I'm trying to adjust the script to allow me to use the Arc browser instead of Safari.
I'm trying to use this applescript code to pass an argument to a query URL, and open the query URL in the Arc browser. I keep getting an error because I think I'm trying to resolve a variable in a property. Any ideas on a better version of this code? The top portion is fully functional code for the Safari browser, and the bottom portion does not work for the Arc browser.
on handle_string(_string)
set SFLibrarySearch to "https://sfpl.bibliocommons.com/search?custom_query=anywhere%3A(" & _string & ")+++language%3A%22eng%22+formatcode%3A(BOOK_CD+OR+AB+)&suppress=true&custom_edit=false"
set AudiblecomLibrarySearch to "http://www.audible.com/search/ref=a_hp_tseft?advsearchKeywords=" & _string & "&field_language=9178177011&ref_=a_search_l2_2_1_srchBin&selectedNodeId=9178176011&qid=1468117332&searchSize=20&sr=1-1"
tell application "Safari"
open location SFLibrarySearch
open location AudiblecomLibrarySearch
activate
end tell
tell application "Arc"
tell front window
tell space "General"
make new tab with properties {URL:SFLibrarySearch}
make new tab with properties {URL:AudiblecomLibrarySearch}
end tell
end tell
activate
end tell
end handle_string
I tried the above code thinking that I could get Arc to do the same thing as Safari. But the only way the Arc code block runs is if the URL does not come with a variable, e.g. https://google.com/.