aboutsummaryrefslogtreecommitdiffstats
path: root/dupe-and-comment.lua
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2021-04-05 16:03:24 +0100
committergarret <garret@airmail.cc>2021-04-05 16:03:24 +0100
commit9c2c5b5424abd2c61a3d293c2c578134fe1de9ba (patch)
treee91c8ac1dd622c6096bb945a337bf9bad77516f7 /dupe-and-comment.lua
downloadaegisub-scripts-9c2c5b5424abd2c61a3d293c2c578134fe1de9ba.tar.gz
aegisub-scripts-9c2c5b5424abd2c61a3d293c2c578134fe1de9ba.tar.bz2
aegisub-scripts-9c2c5b5424abd2c61a3d293c2c578134fe1de9ba.zip
initial commit
Diffstat (limited to 'dupe-and-comment.lua')
-rw-r--r--dupe-and-comment.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/dupe-and-comment.lua b/dupe-and-comment.lua
new file mode 100644
index 0000000..6c31c81
--- /dev/null
+++ b/dupe-and-comment.lua
@@ -0,0 +1,19 @@
+script_name="Dupe and Comment"
+script_description="Copies a line and comments out the original."
+script_author = "garret"
+script_version = "2021-04-05"
+include("utils.lua")
+-- i like seeing the original while editing, and being able to go back to it easily
+
+function comment(subs, sel)
+ for i=#sel,1,-1 do
+ local line=subs[sel[i]]
+ local dupe = util.copy(line)
+ line.comment = false -- going to edit it, so we probably want to see it on the video
+ dupe.comment = true -- this is the actual original one
+ subs.insert(sel[i]+1,dupe) -- putting it on the next line so i don't have to change line
+ end
+ aegisub.set_undo_point(script_name)
+end
+
+aegisub.register_macro(script_name, script_description, comment)