arch1t3cht / Aegisub

Cross-platform advanced subtitle editor, with new feature branches. Read the README on the feature branch.
http://www.aegisub.org
Other
800 stars 34 forks source link

[Feature Request] Ripple editing, anchor editing #161

Open skysphr opened 1 month ago

skysphr commented 1 month ago

Hello, these would really come in handy for subtitle sync:

skysphr commented 1 month ago

Workaround for ripple editing: add this script to the automation directory (on Linux that would be ~/.aegisub/automation/autoload - create the subdirectories if they do not already exist). It should have the extension .moon as it is Moonscript.

tr = aegisub.gettext

export script_name = tr"Select to end"
export script_description = tr"Select until end"
export script_author = "skysphr"
export script_version = "1"

select_to_end = (subs, selection, active) ->
    to_end = {}

    for i, line in ipairs subs
        if i >= active
            table.insert to_end, i

    to_end

aegisub.register_macro script_name, script_description, select_to_end

Then, assign a key binding to the script and use it instead of manually selecting all subtitles to the end, which is no fun.