1
-- Aegisub Automation demonstration script
2
-- Original written by Niels Martin Hansen
3
-- Given into the public domain
5
-- Comment lines (like this line) start with two hyphens, these are ignored when the script is interpreted.
6
-- This script does not do anything useful, it merely displays a message. Think of it as a kind of "hello world" script.
8
-- The following lines define some values identifying the script
9
-- This script is written for Automation version 3
11
-- And it's a "basic ass" processing script. There are no other kinds of scripts though... but this is still required.
13
-- This is the name of the script that shows up in Aegisub
14
name = "Minimal demonstration"
15
-- This is a longer description of the script
16
description = "A very minimal demonstration of the strucrure of an Automation script."
17
-- This defines any configuration that can be done of the script. This is demonstrated in demo 5.
18
-- The empty braces denote an empty table (associative array)
21
-- This is the main function of the script.
22
-- This function is run whenever the script is run
23
function process_lines(meta, styles, lines, config)
24
-- The function aegisub-report_progress changes the position of the progress bar shown while the script is running
25
-- The value given is in percent.
26
aegisub.report_progress(50)
27
-- The aegisub,.output_debug function shows some text
28
aegisub.output_debug("Test script 1 running")
29
aegisub.report_progress(100)
30
-- It is very important that the process_lines function returns an array of lines, otherwise an error will occur
31
-- If an empty array is returned, the entire file is cleared!