Created
June 9, 2021 19:29
-
-
Save Ichunjo/62aec4b65b8a644735af4cca63f025b0 to your computer and use it in GitHub Desktop.
Export the selected lines without tags and line breaks, and display them in a new window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script_name = "Export Text" | |
script_description = "Export the selected lines without tags and line breaks, and display them in a new window" | |
script_version = "0.2" | |
script_author = "Vardë" | |
function export_text(subs, sel) | |
alltext = '' | |
for k, i in ipairs(sel) do | |
line = subs[i] | |
clean = line.text:gsub("{[^}]+}", "") | |
clean = clean:gsub("\\N", " ") | |
alltext = alltext .. clean .. '\n' | |
end | |
local conf = { | |
{ | |
class = "textbox", name = "txt", | |
x = 0, y = 0, width = 40, height = 20, | |
text = alltext | |
} | |
} | |
aegisub.dialog.display(conf, {"Close"}) | |
end | |
aegisub.register_macro(script_name, script_description, export_text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment