The 3rd part means that running this script will run a function called "test". You can see description in the Automation Manager. The name will appear in the menu and as an undo entry when you run the script. 2 of them are defined at the beginning - script_name and script_description. The last line puts an entry in your automation menu. Once you understand how a script that adds blur works, adding more complex functions will be easy because that's just maths.Īegisub.register_macro(script_name, script_description, test) The goal is to explain how to write a basic automation script in as simple terms as possible. This is explained in the Aegisub manual, but since that may be confusing for beginners, I'll provide some specific practical examples. What I want to talk about the most is how to work with the Subtitles object, which is not really a matter of Lua, but rather of Aegisub and the ASS format. That, again, is something you can learn in an hour. It's mostly just if/then/end, the for cycle, gsub, and a few other things.Ī large part of what you need is regular expressions, or rather Lua's simplified pattern matching. You can learn all the Lua stuff you need in an hour. Rather than explaining lua itself, I'll explain more about scripts for Aegisub specifically. You should read lyger's guide first, because I'm not gonna explain the same things again, but I want to provide some more practical tips. I keep hearing people say "I need to learn some Lua" or "I need to learn to write automation scripts", and not many seem to really have gotten into it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |