Satimage Previous | Next
Home Documentation Smile Smile's objects Scheduling tasks smilepause  
smilepause some_delay until escape key wantEsc until arrow key wantArrow suspends the execution of the script for a delay given by some_delay in seconds, possibly 0, or with no limit if some_delay is not specified. During that pause, Smile is fully responsive: you can use your computer normally. Two keys can have a special action while the script is paused with smilepause. If wantEsc is true (the default) the esc key triggers a User canceled error (error number -128). If wantArrow is true (the default is false), the right arrow key (▸) exits smilepause, resuming execution of the script.

You can always resume execution of the script by calling the smileresume command.

Inserting smilepause 0 in a loop makes the interface responsive while the loop is executing and allows for more graphical updates. For instance, smilepause 0 will update the Console.
repeat with the_file in the_list
    set the_name to name of (info for the_file)
    -- perform some task
    quietmsg(the_name & " done")
    smilepause 0
end repeat
While some script is paused with smilepause, you can do any action (possibly except using the right arrow key): you can launch another script. The execution of that other script will take place inside the pause, and the second script will return before the first one.
Copyright ©2008 Paris, Satimage