Search code examples
bashosascript

Setting popup box with osascript and a 10 second delay


I'm looking to setup a popup box for users to see that has a 10 second delay before it exits and the script continues. So far I've got the following.

osascript -e 'tell app "System Events" to display dialog with delay "10" "Running Health Check \r \rPlease allow 30 seconds or more to complete." with title "Health Check"'

I've read that you can use the "delay" function, but I'm having problems getting it inline.


Solution

  • I found my answer, what I needed to do was add in the following...

    giving up after 10 
    

    So my overall script now looks like this...

    osascript -e 'tell app "System Events" to display dialog with delay "10" "Running Health Check \r \rPlease allow 30 seconds or more to complete." giving up after 10 with title "Health Check"'