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

Solved: run script not returning (new name)


  • Subject: Solved: run script not returning (new name)
  • From: Robert Poland <email@hidden>
  • Date: Wed, 16 Jun 2004 12:06:42 -0600

Turns out it was returning and then getting an error which made it appear that it was never returning.

Thanks for the help,

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.


--
Bob Poland - Englewood, CO
http://www.ibrb.org/
_______________________________________________
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.


References: 
 >run script not returning (new name) (From: Robert Poland <email@hidden>)
 >Re: run script not returning (new name) (From: Graff <email@hidden>)

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