• 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: Automator-users Digest, Vol 50, Issue 3, Timeout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automator-users Digest, Vol 50, Issue 3, Timeout


  • Subject: Re: Automator-users Digest, Vol 50, Issue 3, Timeout
  • From: Bernd Schreyer <email@hidden>
  • Date: Wed, 10 Mar 2010 09:24:52 +0100

Read the AppleScript documentation at Mac Dev Center to find out every option concerning the command "display dialog":
http://developer.apple.com/Mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#/ /apple_ref/doc/uid/TP40000983-CH216-SW12


There you can find some helpfull examples to see how to handle user interaction and errors. I personaly would recomend to put every part of the script, where something can go wrong, into a try statement. That makes the script much more robust and can give the user feedback WHAT has gone wrong and not only that something unexpected has happend and nowbody knows what this was. See more examples to handle errors there:
http://developer.apple.com/Mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_error_xmpls.html


If there are other time consuming commands - lets say printing of a more ore less huge document - in the script, you could put that command inside a "with timeout" statement to avoid a timeout error, if printing of the document lasts occasionally longer that the given 2 minutes timeout.
http://developer.apple.com/Mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_control_statements.html#/ /apple_ref/doc/uid/TP40000983-CH6g-130992


But right now, we are still at the Automator-User List, aren't we?

Am 09.03.2010 um 21:01 schrieb email@hidden:

Message: 1 Date: Tue, 9 Mar 2010 16:45:25 +0000 From: "Richard @ Beaver Promotions" <email@hidden> Subject: Apple Timed Out Error To: email@hidden Message-ID: <email@hidden> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Hey Guys,

Thanks for all your help so far... and now for something completely
different!

I have a display dialog box that comes up on alerting the user to do
something.

But this user could be away from his desk on break, making a coffee,
attending a meeting, taking a smoke, anyway but as his desk when this
alert box appears.

How do I correctly stop this dialog box from raising an Apple Timed
Out error?

-----

On another topic this same script checks whether a file that was
created by a cgi script exists on an ftp server.   Due to finder only
mounting
read-only ftp drives I have to dismount and re-mount the ftp drive
every x minutes.  This is quite annoying, I wonder if there is any
alternatives.

Thanks in advance,
Richard, Beaver Promotions


------------------------------

Message: 2
Date: Tue, 09 Mar 2010 19:33:26 +0100
From: "Kern, Oliver" <email@hidden>
Subject: Re: Apple Timed Out Error
To: "Richard @ Beaver Promotions" <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"

Hello Richard,

give this a try:


display dialog "Delete"
buttons {"Yes", "No"} default button 2 giving up after 10 -- set the amount of time before dialogs auto-answer.



Best regards, Oliver


Am 09.03.2010 um 17:45 schrieb Richard @ Beaver Promotions:

Hey Guys,

Thanks for all your help so far... and now for something completely different!

I have a display dialog box that comes up on alerting the user to do something.

But this user could be away from his desk on break, making a coffee, attending a meeting, taking a smoke, anyway but as his desk when this alert box appears.

How do I correctly stop this dialog box from raising an Apple Timed Out error?

-----

On another topic this same script checks whether a file that was created by a cgi script exists on an ftp server. Due to finder only mounting
read-only ftp drives I have to dismount and re-mount the ftp drive every x minutes. This is quite annoying, I wonder if there is any alternatives.


Thanks in advance,
Richard, Beaver Promotions
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Kern, Oliver email@hidden



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/pipermail/automator-users/attachments/20100309/936eed45/attachment.html

------------------------------

Message: 3
Date: Tue, 09 Mar 2010 13:58:01 -0500
From: Daniel Rodrigue <email@hidden>
Subject: Re: Apple Timed Out Error
To: email@hidden
Cc: "Richard @ Beaver Promotions" <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=WINDOWS-1252; format=flowed;
	delsp=yes

Hi Richard,

On Mar 09, 2010, at 11:45, Richard @ Beaver Promotions wrote:

I have a display dialog box that comes up on alerting the user to do
something.

But this user could be away from his desk on break, making a coffee,
attending a meeting, taking a smoke, anyway but as his desk when
this alert box appears.

How do I correctly stop this dialog box from raising an Apple Timed
Out error?
Hum... Do I understand that you want to stop the script if there is no
answer to the «display dialog» or you just want to avoid going to the
«Time Out Error» because there is no answer?

To dismiss quietly the Dialog, use the «giving up» option of the
«display dialog» command.

set theResult to display dialog unicode text ¬
     default answer unicode text ¬
     hidden answer boolean ¬
     buttons {unicode text, ...} ¬
     default button unicode text | integer ¬
     cancel button unicode text | integer ¬
     with title unicode text ¬
     with icon unicode text | integer ¬
     with icon stic ¬
     with icon file ¬
     giving up after integer

To stop the script use the following:

set sResult to button returned of (get display dialog "Please do
something..." buttons {"OK", "Cancel"} giving up after 3)
if sResult = "" then error number -128 -- <<<<< the script will stop
right there.

On another topic this same script checks whether a file that was
created by a cgi script exists on an ftp server.   Due to finder
only mounting
read-only ftp drives I have to dismount and re-mount the ftp drive
every x minutes.  This is quite annoying, I wonder if there is any
alternatives.
You can use the «cURL» UNIX command with the FTP option to read or
write the an FTP server...

Regards,

Dan

--/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\--
Daniel Rodrigue / Simple & Logik
Vox: 450-468-5726 • cel: 514-996-5726
1261 rue Bourgeoys, Longueuil  (Québec) Canada J4M 1Z5
••••••••••••••••••••••••••••••••••••••••••••••••••••••
“Quidquid latine dictum sit, altum sonatur.”
“Peu importe, dit en latin ça sonne profond.”
“Whatever is said in Latin sounds profound.”
--\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/--



------------------------------

_______________________________________________
Automator-users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/automator-users


End of Automator-users Digest, Vol 50, Issue 3 **********************************************


Herzliche Grüße / best regards.

--

Dipl.-Des.
Bernd Schreyer
Forschung & Entwicklung / Konzepte & Design

ERCO GmbH
Brockhauser Weg 80-82
58507 Lüdenscheid
Germany

Tel.:  +49 2351 551 233
Fax: +49 2351 551 8233
email@hidden
www.erco.com

Amtsgericht Iserlohn HRB 3922
USt-IdNr.: DE 125 797 114
Geschäftsführer:
Tim Henrik Maack, Kay Pawlik
Mark Oliver Schreiter, Dr. Dirk Stahlschmidt

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Apple Timed Out Error
  • Next by Date: Setting up variable in Automator
  • Previous by thread: Re: Apple Timed Out Error
  • Next by thread: Setting up variable in Automator
  • Index(es):
    • Date
    • Thread