• 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: Timeouts & FileMaker Scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Timeouts & FileMaker Scripts


  • Subject: Re: Timeouts & FileMaker Scripts
  • From: Graff <email@hidden>
  • Date: Wed, 03 Nov 2004 20:02:39 -0500

To trap an error surround the statement with a try block
----
try
tell application "FileMaker Pro"
open file "hd/directory/file" with password "BlahBlah"
end tell
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
----


If you didn't care about getting an error message you could leave out the "on error" part:
----
try
tell application "FileMaker Pro"
open file "hd/directory/file" with password "BlahBlah"
end tell
end try
----


You can enclose whole blocks of a script in a try block and if an error occurs in any part of the block it will skip right ahead to the "on error" statement or to the "end try" statement.


To answer your second question, if you ignore application responses then you don't need any timeout clause at all. The script will do the command and will then stop paying attention to the target.


Basically in a normal statement the script will call the other application and it will wait for a response. It will wait for a length of time equal to the timeout and the script will be paused until it either times out or it gets a response. However, if you say that you are ignoring application responses then your script will not pause at all and it will not listen for an answer back.


I would use a try block if you need to recover from an error or if you want to be informed if there was an error. I would use an ignore block if you don't need to know if the command worked or not.


- Ken

On Nov 3, 2004, at 1:10 PM, Andi Elsasser wrote:

Thanks, Ken. I'll try that.

One more question: Since there are 3 different scripts being invoked, is there
a way to error trap, in the AS that's giving the "no user interaction allowed"
message, so that I know which of the three AppleScripts following that message
is failing?


Can I leave the timeout clause
altogether, or were you just simplifying below?


From: Graff <email@hidden> Date: 2004/11/03 Wed PM 12:58:43 EST To: AppleScript Users <email@hidden> Subject: Re: Timeouts & FileMaker Scripts

Try doing the call in an "ignoring application responses" block.  That
should allow the AppleScript to continue executing after it tells
FileMaker to open the file:
----
ignoring application responses
     tell application "FileMaker Pro"
         open file "hd/directory/file" with password "BlahBlah"
     End tell
end ignoring
----

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Re: Timeouts & FileMaker Scripts (From: Andi Elsasser <email@hidden>)

  • Prev by Date: Re: [ANN] New comprehensive AppleScript book
  • Next by Date: Re: Bridge anyone? [not off topic]
  • Previous by thread: Re: Re: Timeouts & FileMaker Scripts
  • Next by thread: Re: Timeouts & FileMaker Scripts
  • Index(es):
    • Date
    • Thread