• 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
'with timeout' and scripting additions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'with timeout' and scripting additions


  • Subject: 'with timeout' and scripting additions
  • From: Donald Hall <email@hidden>
  • Date: Thu, 21 Apr 2005 00:11:49 -0600

According to Perry's Nutshell book, page 152, 'with timeout' should work with a scripting addition command called inside a tell block that targets another application.

For example:

try
with timeout of 5 seconds
tell application "Finder"
get version
display dialog "this is a timeout test"
end tell
end timeout
on error errMsg
display dialog errMsg
end try

This works as expected if the dialog is left on the screen for more than 5 seconds a timeout error is generated.

However, if I change the script to the following:

script TimeoutTest
display dialog "this is a timeout test"
end script

try
with timeout of 5 seconds
tell application "Finder"
get version
run script TimeoutTest
end tell
end timeout
on error errMsg
display dialog errMsg
end try

the timeout error does not occur, even though 'run script' is another scripting addition.

I could have sworn this worked some years ago (OS 9 maybe). What gives? What am I missing?

Thanks for any insights,

Don

--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
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


  • Follow-Ups:
    • Re: 'with timeout' and scripting additions
      • From: Martin Orpen <email@hidden>
  • Prev by Date: Re: OS 9: Automatic capture of text in a window
  • Next by Date: Re: 'with timeout' and scripting additions
  • Previous by thread: Re: simple file copy
  • Next by thread: Re: 'with timeout' and scripting additions
  • Index(es):
    • Date
    • Thread