Aegisub/automation/auto3/demos/1-minimal.lua

34 lines
1.6 KiB
Lua
Raw Normal View History

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