Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export script_name = "Add tags"
- export script_description = "Just a demo script"
- export script_author = "dreamer2908"
- export script_version = "0.1"
- processSubtitle = (subtitle, selected, active, tags) ->
- for si,li in ipairs(selected)
- line = subtitle[li]
- line.text = "{"..tags.."}"..line.text
- subtitle[li] = line
- return selected
- mainDialog = {
- {class:"label",x:0,y:0,width:1,height:1,label:"Tags to add:"},
- {class:"edit", name:"tags", value:"", x:1, y:0}
- }
- macro_function = (subtitle, selected, active) ->
- pressed, results = aegisub.dialog.display(mainDialog, {"OK", "Cancel"}, {cancel:"Cancel", ok:"OK"})
- if pressed == "OK"
- tags = results.tags
- processSubtitle(subtitle, selected, active, tags)
- aegisub.set_undo_point(script_name)
- else aegisub.cancel()
- return selected
- aegisub.register_macro(script_name, script_description, macro_function)
Advertisement
Add Comment
Please, Sign In to add comment