aboutsummaryrefslogtreecommitdiffstats
path: root/tagstrip.lua
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2021-06-13 15:00:29 +0100
committergarret <garret@airmail.cc>2021-06-13 15:00:29 +0100
commite41d6199d66e7cb7f2faf52989de30c327c07b8a (patch)
tree2cf3fe6851c039ee9300d393c4cc99d3142c2222 /tagstrip.lua
parent4433ba57a8acbbcbd7b32f520355676bb46720b8 (diff)
downloadaegisub-scripts-e41d6199d66e7cb7f2faf52989de30c327c07b8a.tar.gz
aegisub-scripts-e41d6199d66e7cb7f2faf52989de30c327c07b8a.tar.bz2
aegisub-scripts-e41d6199d66e7cb7f2faf52989de30c327c07b8a.zip
new ones
Diffstat (limited to 'tagstrip.lua')
-rw-r--r--tagstrip.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/tagstrip.lua b/tagstrip.lua
new file mode 100644
index 0000000..1a65a98
--- /dev/null
+++ b/tagstrip.lua
@@ -0,0 +1,26 @@
+script_name = "tagstrip"
+script_description = "nukes tags\n(and comments)"
+script_author = "garret"
+script_version = "2021-06-13"
+include("cleantags.lua")
+
+function strip(sub, sel)
+ for h, i in ipairs(sel) do
+ line = sub[i]
+ line.text = line.text:gsub("{[^}]-}","")
+ sub[i] = line
+ end
+ aegisub.set_undo_point(script_name)
+end
+
+function clean(sub, sel)
+ for h, i in ipairs(sel) do
+ line = sub[i]
+ line.text = cleantags(line.text)
+ sub[i] = line
+ end
+ aegisub.set_undo_point(script_name)
+end
+
+aegisub.register_macro(script_name, script_description, strip)
+--aegisub.register_macro("Clean Tags", script_description, clean) -- dupe of existing aegi one