• 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: run script not returning (new name)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run script not returning (new name)


  • Subject: Re: run script not returning (new name)
  • From: Graff <email@hidden>
  • Date: Wed, 16 Jun 2004 12:52:42 -0400

Maybe you are getting some other sort of error in the other script which is causing both scripts to fail? Try this and see what error you capture:
----
try
with timeout of (60 * 60) seconds
run script ":Library:Scripts:Universal Scripts:ReadMinders" as alias
end timeout
on error the error_message number the error_number
set the error_text to "Error: " & the error_number & ". " & the error_message
display dialog the error_text buttons {"OK"} default button 1
return the error_text
end try
----

By the way, this is just the "Message and Return" error handler that Apple provides in its contextual menu for Script Editor. Some of those scripts are pretty useful, I definitely don't use them nearly enough.

- Ken

On Jun 16, 2004, at 12:34 PM, Robert Poland wrote:

Looks like I didn't make myself clear.

There is no "Cancel" button.

When the Dialog is accepted in the ReadMinders script I want control to return to the original script.

When the "Cancel" button is pressed in the default dialog box it returns an error -128 which quits the script. The quit script returns the error to the calling script which also quits. I would change the call to:
----
try
with timeout of (60 * 60) seconds
run script ":Library:Scripts:Universal Scripts:ReadMinders" as alias
end timeout
end try
----

You can, of course, also put some error handling in there if you want. You could also wrap the dialog box command in the called script with a try block so that the "Cancel" button error gets handled properly.

No matter what it is still a good practice to wrap the "run script" command with a try block so that errors can be handled gracefully.

- Ken

On Jun 16, 2004, at 9:09 AM, Robert Poland wrote:

Hi,

OS 10.3.4.
I have a script that ends with;

with timeout of (60 * 60) seconds
run script ":Library:Scripts:Universal Scripts:ReadMinders" as alias
end timeout

The "ReadMinders" script ends with a dialog box. When the Dialog box is clicked the script ends and does not return to the calling script.

What have I overlooked? Do I need to deal with the clicked buttons?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Solved: run script not returning (new name)
      • From: Robert Poland <email@hidden>
References: 
 >run script not returning (new name) (From: Robert Poland <email@hidden>)

  • Prev by Date: run script not returning (new name)
  • Next by Date: Re: Mount OS X Volume from OS 9
  • Previous by thread: run script not returning (new name)
  • Next by thread: Solved: run script not returning (new name)
  • Index(es):
    • Date
    • Thread