• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Opening a specified URL in a specified browser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening a specified URL in a specified browser


  • Subject: Re: Opening a specified URL in a specified browser
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Thu, 28 Dec 2006 09:24:00 +1100


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
References: 
 >Opening a specified URL in a specified browser (From: Craig Hoyt <email@hidden>)

  • Prev by Date: Opening a specified URL in a specified browser
  • Next by Date: Finder open ... using...
  • Previous by thread: Opening a specified URL in a specified browser
  • Next by thread: Re: Opening a specified URL in a specified browser
  • Index(es):
    • Date
    • Thread