• 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 654
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: AppleScript-Users Digest, Vol 3, Issue 654
  • From: "hackmiester (Hunter Fuller)" <email@hidden>
  • Date: Fri, 29 Dec 2006 20:12:26 -0600


On 29 December 2006, at 16:17, Craig Hoyt wrote:

Hey, thanks Doug and J. Stewart,

I guess I didn't frame my question correctly or I'm getting behavior that is unfamiliar to AS. I'm doing this (Safari misspelled intentionally to show problem):

try
tell application "Saffari"
activate
end tell
end try

This will produce a dialog asking the user to 'Find' the application 'Saffari'. Is this now a Finder issue? Is there any way to suppress this dialog? try doesn't seem to work here. Am I doing this correctly? Is there a more appropriate way to do this such as actually checking for the existence of the application first? The problem reverts to the fact that a human enters the application name

D'you think you could simply have the user browse to the application using a file finding dialogue?


- thus I must allow for typos. I just want it to fail silently.

Sorry for the waste of bandwidth on this... I did try to find an answer to this myself, maybe I didn't search using the correct terms.

Craig

Message: 5
Date: Thu, 28 Dec 2006 12:54:23 -0700
From: Doug McNutt <email@hidden>
Subject: Re: Opening a specified URL in a specified browser
To: email@hidden
Message-ID: <p05100300c1b9d11b2a05@[192.168.1.14]>
Content-Type: text/plain; charset="us-ascii"

At 10:04 -0800 12/28/06, Craig Hoyt wrote:
Is there an ignore all errors statement?

Have a look at AppleScript's "try" and "on error" command structures.

--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.


Message: 8 Date: Fri, 29 Dec 2006 06:39:38 -0500 From: "J. Stewart" <email@hidden> Subject: Re: AppleScript-Users Digest, Vol 3, Issue 652 To: email@hidden Message-ID: <r02010500-1048-4464DF10973111DB91E2000A95D992BC@[10.0.1.254]> Content-Type: text/plain; charset=US-ASCII

On 12/28/06 at -0800 Craig Hoyt said this

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.


There are 2 scripts below each reacts differently to the error. Run them both and note the changes to the second script. This should give you what you want.


--> Cut <--
try -- this will display an alert
error number 1
on error errMsg number errNum
display alert ("Error # " & errNum) message errMsg buttons {"Cancel"} giving up after 5
end try
--> Cut <--


--> Cut <--
try -- this will NOT display an alert
error number 1
-- on error errMsg number errNum -- on error line commented out
display alert ("Error # " & errNum) message errMsg buttons {"Cancel"} giving up after 5
end try
--> Cut <--


JBS
--
Hard work pays off in the future. Laziness pays off now.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
@gmail.com
Archives: http://lists.apple.com/mailman//archives/applescript-users


This email sent to email@hidden

-- hackmiester (Hunter Fuller)

<badaboom> who can help me ? i'm french and i don't know irc
<Paladine> can't help you with the being french part, you are screwed their mate





Phone Voice: +1 251 589 6348 Fax: Call the voice number and ask.

Email
General chat: email@hidden
Large attachments: email@hidden
SPS-related stuff: email@hidden

IM
AIM: hackmiester1337
Skype: hackmiester31337
YIM: hackm1ester
Gtalk: hackmiester
MSN: email@hidden
Xfire: hackmiester






_______________________________________________ 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: 
 >Re: AppleScript-Users Digest, Vol 3, Issue 654 (From: Craig Hoyt <email@hidden>)

  • Prev by Date: Re: Quirks of Annotate script
  • Next by Date: Re: AppleScript-Users Digest, Vol 3, Issue 654
  • Previous by thread: Re: AppleScript-Users Digest, Vol 3, Issue 654
  • Next by thread: Re: AppleScript-Users Digest, Vol 3, Issue 654
  • Index(es):
    • Date
    • Thread