• 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: AppleScript-Users Digest, Vol 3, Issue 652
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 3, Issue 652


  • Subject: Re: AppleScript-Users Digest, Vol 3, Issue 652
  • From: Craig Hoyt <email@hidden>
  • Date: Thu, 28 Dec 2006 11:43:18 -0800

This is a followup to Malcoms reply to my questions...

I just tested and your solution and it is working perfectly. I modified it slightly as I wanted the new page to open in the existing window. I just removed the line < make new document at beginning of documents >. This worked great! I have it working where the user can specify the browser and the URL.

As for the other problem (ignoring errors), I still have problems here...

In the above question (opening a URL in a browser) - if the user chooses FireFox and FireFox does not exist on that computer a dialog is presented requesting the user 'Find' the application. I want to suppress this dialog. Is this possible? Try-End Try doesn't seem to work. Is there a more direct way to suppress ANY and ALL errors.

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
  • Follow-Ups:
    • Re: AppleScript-Users Digest, Vol 3, Issue 652
      • From: "J. Stewart" <email@hidden>
  • Prev by Date: Re: Opening a specified URL in a specified browser
  • Next by Date: Re: Replace all caps into plain
  • Previous by thread: Re: Outcome is incorrect of grouped "group boxes"
  • Next by thread: Re: AppleScript-Users Digest, Vol 3, Issue 652
  • Index(es):
    • Date
    • Thread