From 3c90e77dc7adfab7869cbd2f5344d7f441e3a2e1 Mon Sep 17 00:00:00 2001 From: garret Date: Wed, 11 Aug 2021 21:32:54 +0100 Subject: compatibility with significance (same things can go in fx field) also changed some wording --- chapters.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chapters.lua b/chapters.lua index e9ade7d..a3f65f6 100644 --- a/chapters.lua +++ b/chapters.lua @@ -1,5 +1,5 @@ script_name = "Chapter Generator" -script_description = "makes chapters" +script_description = "Makes XML chapters for matroska." script_author = "garret" script_version = "2.0.0-dev" @@ -38,8 +38,8 @@ function get_sane_path() end end -function get_user_path(sane_path) - local path = aegisub.dialog.save("Save Chapter File", sane_path, "chapters.xml", "XML files (.xml)|.xml|All Files (.)|.", false) +function get_user_path(default_dir) + local path = aegisub.dialog.save("Save Chapter File", default_dir, "chapters.xml", "XML files (.xml)|.xml|All Files (.)|.", false) return path end @@ -49,7 +49,8 @@ function main(sub) for i=1,#sub do local line = sub[i] if line.class == "dialogue" then - if line.effect == "chapter" then + local fx = line.effect + if fx:match("[Cc]hapter") or fx:match("[Cc]hptr") or fx:match("[Cc]hap") then line.comment = true table.insert(times, line.start_time) table.insert(names, line.text) @@ -58,7 +59,7 @@ function main(sub) end end aegisub.set_undo_point(script_name) - local chapters = "\n\n\n\n \n" + local chapters = "\n\n\n \n" for j, k in ipairs(times) do local humantime = ms_to_human(k) local name = names[j] @@ -73,7 +74,7 @@ function main(sub) chapfile:close() aegisub.log("saved to "..path) else - aegisub.log("\n\n") + aegisub.log("\n\n") aegisub.log(chapters) end end -- cgit v1.2.3-70-g09d2