Skip to content

Instantly share code, notes, and snippets.

@qixils
Created December 29, 2023 17:56
Show Gist options
  • Save qixils/7fb8f74ad53220550b7a3ad4259c999c to your computer and use it in GitHub Desktop.
Save qixils/7fb8f74ad53220550b7a3ad4259c999c to your computer and use it in GitHub Desktop.
An Aegisub script to set the background on all selected lines of text to 25% opacity
-- Macro that adds BG transparency tags in front of every selected line
local tr = aegisub.gettext
script_name = tr"Add BG transparency"
script_description = tr"Adds 25% background opacity to the start of all selected lines"
script_author = "Lexi"
script_version = "1"
function add_edgeblur(subtitles, selected_lines, active_line)
for z, i in ipairs(selected_lines) do
local l = subtitles[i]
l.text = "{\\3a&H40&}" .. l.text
subtitles[i] = l
end
aegisub.set_undo_point(script_name)
end
aegisub.register_macro(script_name, tr"Adds BG opacity to all selected lines", add_edgeblur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment