-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRLO.lua
More file actions
31 lines (22 loc) · 847 Bytes
/
Copy pathRLO.lua
File metadata and controls
31 lines (22 loc) · 847 Bytes
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
27
28
29
30
31
---- Script Info ----
script_name = 'RLO'
script_description = 'Reverses the order of the selected lines.'
script_author = 'OHIOXOIHO'
script_version = '1.1'
script_namespace = "Selected.LineReverce05"
function reverseSelectedLines(subs, selected_lines)
if #selected_lines == 0 then
aegisub.debug.out("No lines selected.")
return
end
local totalLines = #subs
for i = 1, math.floor(#selected_lines / 2) do
local index1 = selected_lines[i]
local index2 = selected_lines[#selected_lines - i + 1]
local temp = subs[index1]
subs[index1] = subs[index2]
subs[index2] = temp
end
aegisub.set_undo_point("Reverse Selected Lines Arrangement")
end
aegisub.register_macro("Reverse Selected Lines Order", "Reverse the arrangement of selected lines", reverseSelectedLines)