Re: display message while script is running
Re: display message while script is running
- Subject: Re: display message while script is running
- From: kai <email@hidden>
- Date: Mon, 6 Dec 2004 04:45:56 +0000
On Thu, 2 Dec 2004 13:27:21 +0100, Jan-Bultereys wrote:
I have a script where the runtime is pretty long....
Is there a way to display a message on the screen while the script is
running and
disappear when it's done?
If you *really* wanted to do this with vanilla dialogs, Jan, then you
may be able to achieve it by splitting the job between 2 scripts. (The
example below opens and closes several dialogs as the main script
progresses.)
The purpose of the following short script would be to merely display
the dialog(s):
-----------------
to displayDialog(msg)
activate
display dialog msg buttons {"Processing..."} default button 1 with
icon 1
end displayDialog
-----------------
Save this as a stay-open application called, say, "Progress Indicator".
The main script might then work something like this:
-----------------
to closeDialog()
tell application "System Events" to tell process "Progress Indicator"
set frontmost to true
if (count windows) > 0 then keystroke return
end tell
end closeDialog
to openDialog(msg)
closeDialog()
ignoring application responses
tell application "Progress Indicator" to displayDialog(msg)
end ignoring
end openDialog
repeat with n from 1 to 3
openDialog("Please wait while item " & n & " is processed...")
delay 3 -- simulate processing
end repeat
closeDialog()
ignoring application responses
quit application "Progress Indicator"
end ignoring
-----------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden