Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Simpler open URL syntax for all browsers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Simpler open URL syntax for all browsers
Authored by: houchin on Jul 30, '02 09:00:40AM

Hi all,

You can actually simplify things a bit and create an applescript that works will all browsers, since the perl script from daeley is actually using AppleScript to do most of the work.

Instead of using GetURL, openURL, ... use:
system "osascript -e 'tell application \\"$browser\\" to open location \\"$url\\"'";


If you want this to run in your default browser, I believe you can just use:
system "osascript -e 'open location \\"$url\\"'";

I've tested this with IE, OmniWeb, Mozilla and Chimera.



[ Reply to This | # ]
Simpler open URL syntax for all browsers
Authored by: balston on Jul 30, '02 03:54:21PM

Tried this script modification and it didn't work. Got the following errors:


Scalar found where operator expected at /Users/balston/bin/vt line 25, near ""osascript -e 'tell application \\"$browser"
(Missing operator before $browser?)
syntax error at /Users/balston/bin/vt line 25, near ""osascript -e 'tell application \\"$browser"
Backslash found where operator expected at /Users/balston/bin/vt line 25, near "$browser\"
(Missing operator before \?)
Scalar found where operator expected at /Users/balston/bin/vt line 25, near "" to open location \\"$url"
(Missing operator before $url?)
Backslash found where operator expected at /Users/balston/bin/vt line 25, near "$url\"
(Missing operator before \?)
Execution of /Users/balston/bin/vt aborted due to compilation errors.


I replaced the entire line:

$todo = "\'Tell application \"$browser\" to getURL \"$url\"\'";

with the suggested line with no luck. I'm probably just don't know what the heck I'm doing. I don't know Perl or AppleScript very well at all. But, any input would be appreciated.



[ Reply to This | # ]