There functions are used to report various status and progress back to the GUI while a script is running.
A progress dialogue box is always shown when an Automation 4 Lua script is running. You can use these functions to control what is displayed in it.
Synopsis: aegisub.progress.set(percent)
Set the position of the percent-done bar in the progress window.
percent
(number
)Synopsis: aegisub.progress.task(msg, ...)
Set the "task" text in the progress window, which is the small text below the progress bar showing what the script is currently doing.
msg
(string
)string.format
function for details on format strings....
Synopsis: aegisub.progress.title(title, ...)
Set the title of the progress window, which is is the large text displayed above the progress bar. This text should usually not change while the script is running. By default this is set to the name of the macro running.
title
(string
)string.format
function for details on format strings.
...
Synopsis: cancelled = aegisub.progress.is_cancelled()
Tells whether the user has clicked on the Cancel button.
You should call this function regularly during long operations, and if it's true call `aegisub.cancel()` to rollback all changes and immediately end execution of the script.
cancelled
(boolean
)false
if the user has not clicked the Cancel button, true
if the user has
clicked Cancel. If is_cancelled
returns true
all subsequent calls to it in
the current execution will also return true
.The primary support for script debugging in Automation 4 Lua is through sending debug messages to the message log integrated in the progress window.
If a script shows a debug or other message, the progress window stays open after the script has finished running until the user clicks the Close button. Please consider whether it's really that important that the user sees your messages. Blocking other input to the program to display something that might be irrelevant to the user can create a bad experience.
Synopsis:
aegisub.debug.out(msg, ...)
aegisub.debug.out(level, msg, ...)
aegisub.log(msg, ...)
aegisub.log(level, msg, ...)
The two names are synonymous; you can use either name depending on your preference.
Sends a message to the message log, optionally with a specific severity level. The user can control in Aegisub's options the highest level messages that will be shown.
level
(number
)msg
(string
)string.format
function for details on format strings....
The following severity levels are suggested: