Re: Opening a specified URL in a specified browser
Re: Opening a specified URL in a specified browser
- Subject: Re: Opening a specified URL in a specified browser
- From: Craig Hoyt <email@hidden>
- Date: Thu, 28 Dec 2006 10:04:56 -0800
Thanks for the reply Malcom,
As you can tell I'm not too savvy on AppleScript. Your correction on
opening a URL looks exactly what I want. I'll try later. Your second
example confuses me. It seems It WILL produce an error dialog, I want
it to fail without doing anything - these scripts are being run
remotely - there is no way to dispose of any dialogs that AS produces.
Is there an ignore all errors statement?
Thanks,
Craig
Message: 2
Date: Thu, 28 Dec 2006 09:24:00 +1100
From: Malcolm Fitzgerald <email@hidden>
Subject: Re: Opening a specified URL in a specified browser
To: applescript users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On 28/12/2006, at 8:54 AM, Craig Hoyt wrote:
Happy Holidays All,
I'm currently going backwards on my project now... I had the 'open
location my_url' working and now I can't seem to even make this work
anymore.
I have a small background application (not AS) that calls AS
routines.
One such call is:
tell application "Safari" to activate
open location "http://www.google.com/"
end tell
location isn't a Safari object, you'll find open location in standard
additions. It uses system preferences to open a location in any given
browser. You can simply say:
open location "http://www.google.com/" --> open url in default browser
To do the same thing within safari is much more effort:
tell application "Safari"
make new document at beginning of documents
set URL of document 1 to "http://www.google.com.au"
end tell
A second issue... I have another script that allows one to launch
(activate) an application from a user input. If the name selected is
misspelled or does not exist a dialog appears requesting the user
find
the file. I would like to have this fail without displaying any
dialog. Is this what the try is used for or is there some other way I
can stop a dialog from appearing.
try
open application XYZ
on error m number n
display dialog m
end
malcolm
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden