Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Confirmation Dialog Box with Timeout

I have a automator.app (using AppleScript) that I use to connect to my local server when I am on the same network.

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

It starts with the 'Ask for Confirmation' command.


Select ‘OK’ if you are on the Local Network and want to connect to the server.

[OK] [Cancel]


Then it runs 5 small AppleScripts to connect to 5 folders on my local server.


---------


If I am traveling and cannot connect to my local network, I cancel the action, otherwise I select [OK] and connect to my local server.


Because most of my use in on my local network, I would like to change the 'Ask for Confirmation' to an AppleScript that will pause for 'xx' seconds then automatically run if not canceled or run before the time out if I choose.


the dialog would be something like.


You will be connected to your local server in 'xx' second.

Select ‘OK’ to connect now.

Press cancel if you are not on your local network.


[OK] [Cancel]


(note: is would be nice if the 'xx' time would count down to indicate time remaining)


Can someone offer a solution? You help is appreciated. Thanks.




Posted on Aug 14, 2019 7:18 AM

Reply
Question marked as Best reply

Posted on Aug 21, 2019 11:57 AM

You can't do this with Automator - the 'Ask for confirmation' action just doesn't support it.


However, you can do it with AppleScript. Put this into a 'Run AppleScript' action:


on run {input, parameters}

set dialogReply to display dialog "Select \"OK\" to connect now

Press \"Cancel\" if you are not on your local network" buttons {"Cancel", "OK"} default button "OK" giving up after 10

return dialogReply

end run


The dialog will appear, and either clicking "OK" or waiting for the timeout will allow the workflow to continue. Clicking "Cancel" will terminate the flow.

1 reply
Question marked as Best reply

Aug 21, 2019 11:57 AM in response to Diveboss164

You can't do this with Automator - the 'Ask for confirmation' action just doesn't support it.


However, you can do it with AppleScript. Put this into a 'Run AppleScript' action:


on run {input, parameters}

set dialogReply to display dialog "Select \"OK\" to connect now

Press \"Cancel\" if you are not on your local network" buttons {"Cancel", "OK"} default button "OK" giving up after 10

return dialogReply

end run


The dialog will appear, and either clicking "OK" or waiting for the timeout will allow the workflow to continue. Clicking "Cancel" will terminate the flow.

Confirmation Dialog Box with Timeout

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.