Re: Displaying Dialog with text only
Re: Displaying Dialog with text only
- Subject: Re: Displaying Dialog with text only
- From: Sander Tekelenburg <email@hidden>
- Date: Thu, 28 Feb 2002 15:19:41 +0100
At 10:59 +0100 UTC, on 28-02-2002, Serge Belleudy-d'Espinose wrote:
>
At 16:10 -0500 27/02/02, Jean-Claude Tremblay wrote:
>
>
>Is their a way in a middle of a script to display a text only dialog and
>
>have it automaticly close when the script is finnish executed?
Not in 'plain vanilla' AppleScript. Once you've put up a dialog, you
can't refer to it anymore. If you know exactly how long the script is
going to take you could put up a dialog with a preset time-out, but
that would be pretty ugly. If only because then if something fails and
you'd want to inform the user, you can't put up a dialog before the
previous dialog has vanished.
I believe it's possible with the aid of a third-party Scripting
Addition like "AkuaSweets". Otherwise DialogDirector. You can find
Scripting Additions at <
http://osaxen.com>. Note though that almost
none of them work under Mac OS X.
>
>Or displaying a progress bar...
>
>
Displaying a dialog will pause your script, and there's no progress
>
bar.
Beware, incoming evil...
(* As always, beware of linebreaks *)
set theBar to "|"
set theList to {"seconds", "minutes", "hours", "days", "weeks",
"fortnights", "months", "years"}
set theTimes to 1
set theStatus to "Remaining time... (calulating)"
set theMessage to "Preparing..." & return & return
set anIcon to 1
repeat until theTimes = 49
display dialog theMessage & theBar & return & theStatus giving up
after 1 buttons {"OK"} default button 1 with icon anIcon
set theBar to theBar & "|"
set theTimes to theTimes + 1
if theTimes > 7 then
set theMessage to "Extracting..." & return & return
end if
if theTimes > 10 then
set aNumber to random number from 1 to 8
set aUnit to item aNumber of theList
set n to random number from 1 to 60
set theStatus to "Remaining time: " & n & " " & aUnit
end if
if theTimes > 14 then
set theMessage to "Initiating..." & return & return
end if
if theTimes > 21 then
set theMessage to "Procreating..." & return & return
end if
if theTimes > 28 then
set theMessage to "Gathering..." & return & return
end if
if theTimes > 35 then
set anIcon to random number from 0 to 2
set theMessage to "Formatting..." & return & return
end if
if theTimes = 38 then
singit()
end if
if theTimes > 42 then
set anIcon to 1
set theMessage to "Finishing..." & return & return
end if
end repeat
set theMessage to "Your proress bar is ready now." & return & return
display dialog theMessage & theBar giving up after 5 buttons {"Cancel"}
default button 1 with icon 1
set theMessage to " ||||||||
----" & return & return & "
|||| " & return & return
display dialog theMessage & theBar & "||||||||||||||" buttons {"
..."} default button 1
on singit()
ignoring application responses
tell application "Finder"
try
say ,
"[[emph +]] [[pbas 45 ; rate - 100]] Oh [[pbas 43]] oh
[[pbas 41.5; rate
- 44]] say [[pbas 44; rate - 6]] can [[pbas 49; rate - 43]] you [[rate +
43]] [[pbas 54.5]] see" using "Junior"
say ,
" [[emph +]] [[volm .25]] [[pbas 67]] [[rate - 66]] by
[[pbas 63.5]] the
[[pbas 62]] [[rate - 80]] dawnz [[pbas 54]] [[emph +]] er [[pbas 57]] lee
[[emph +]] [[pbas 57.5]] light?" using "Junior"
end try
end tell
end ignoring
end singit
{ducks...}
--
Sander Tekelenburg, <
http://www.euronet.nl/~tekelenb/>
_______________________________________________
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.