aboutsummaryrefslogtreecommitdiffstats
path: root/tagstrip.lua
blob: 1a65a980f909e9dc7a15e8056430428640db9716 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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