I’ve created a stripped-down browser using Fluid (http://fluidapp.com/) and would like to use it to open the URL’s in the following script so that they open more quickly and in one, centralised tool (I’d prefer not to have them open in Safari or Firefox).
Here is the first part of the script:
-- ------------------------------------------------------------
-- Dialog box into which search queries are entered
-- ------------------------------------------------------------
set search to text returned of (display dialog "Enter Search Query - Joint Terms with \"+\":" default answer "" buttons {"Search", "Cancel"} default button "Search")
-- ------------------------------------------------------------
-- Sets the clipboard to the value of 'search'
-- ------------------------------------------------------------
set the clipboard to search
-- ------------------------------------------------------------
-- Sets language/tool selection options
-- ------------------------------------------------------------
set lang to {"German", "Dutch", "Google Tools", "Reference", "Currency Converter"}
-- ------------------------------------------------------------
-- Allows for language/tool selection
-- ------------------------------------------------------------
set langSelect to (choose from list lang with prompt "Make Selection:" without multiple selections allowed) as text
-- ------------------------------------------------------------
-- Changes encoding from UTF-8 to predicated ISO-8859-1
-- ------------------------------------------------------------
set searchEncoded to do shell script "/bin/echo -n " & quoted form of search & " | iconv -f utf8 -t iso-8859-1 | php -r '$handle = fopen (\"php://stdin\",\"r\"); $line = fgets($handle);echo urlencode($line);'"
-- ------------------------------------------------------------
-- Begin of if-statements for search engines choices
-- ------------------------------------------------------------
if langSelect is "German" then
set sites to {"Linguee", "Glosbe", "Beolingus", "Leo", "DictData", "Woerterbuch.info", "Langenscheidt", "Uni Leipzig", "Redensarten", "Google", "Google Images", "Wiki.de", "DWDS", "Lisa", "SAP.com", "Pons", "Dict.cc", "Eur-Lex", "Europarl", "UBS Banking", "MS Language Portal", "WIPO", "IATE", "All Sites"}
set chosen to (choose from list sites with prompt "Make Selection:" without multiple selections allowed) as text
if chosen is "Linguee" then
open location "http://www.linguee.com/english-german/search?sourceoverride=none&source=auto&query=" & searchEncoded
else if chosen is "Glosbe" then
open location "http://en.glosbe.com/de/en/" & searchEncoded
else if chosen is "Beolingus" then
open location "http://dict.tu-chemnitz.de/dings.cgi?lang=en&service=deen&opterrors=0&optpro=0&query=" & searchEncoded & "&iservice=&comment=&email="
etc. etc. etc.
I’ve tried using things like:
Tell “MyBrowser.app” to open “www.linguee.com” etc.
tell application “MyBrowser.app”
OpenURL “http://www.macosxhints.com/”
end tell
do shell script “open -a MyBrowser.app http://linguee.com”
Nothing like this has worked, however.
Can anyone suggest a way to get this to work? The above suggestions seem to have worked for others as I’ve found these on various different sites, but for some reason they have not worked so far for me.
Thanks,
bowjest