diff --git a/MPV/LUA/main.lua b/MPV/LUA/main.lua index dee6816..60942b4 100644 --- a/MPV/LUA/main.lua +++ b/MPV/LUA/main.lua @@ -2731,6 +2731,11 @@ end) mp.register_script_message('medios-load-url', function() _lua_log('medios-load-url handler called') + -- Close the main menu first + if ensure_uosc_loaded() then + _lua_log('medios-load-url: closing main menu before opening Load URL prompt') + mp.commandv('script-message-to', 'uosc', 'close-menu') + end M.open_load_url_prompt() end) @@ -2837,18 +2842,19 @@ function M.show_menu() _lua_log('[MENU] M.show_menu called') -- Build menu items + -- Note: UOSC expects command strings, not arrays local items = { - { title = "Load URL", value = {"script-message-to", mp.get_script_name(), "medios-load-url"} }, + { title = "Load URL", value = "script-message medios-load-url" }, { title = "Get Metadata", value = "script-binding medios-info", hint = "Ctrl+i" }, { title = "Delete File", value = "script-binding medios-delete", hint = "Ctrl+Del" }, - { title = "Cmd", value = {"script-message-to", mp.get_script_name(), "medios-open-cmd"}, hint = "screenshot/trim/etc" }, - { title = "Download", value = {"script-message-to", mp.get_script_name(), "medios-download-current"} }, - { title = "Change Format", value = {"script-message-to", mp.get_script_name(), "medios-change-format-current"} }, + { title = "Cmd", value = "script-message medios-open-cmd", hint = "screenshot/trim/etc" }, + { title = "Download", value = "script-message medios-download-current" }, + { title = "Change Format", value = "script-message medios-change-format-current" }, } -- Conditionally add "Start Helper" if not running if not _is_pipeline_helper_ready() then - table.insert(items, { title = "Start Helper", hint = "(pipeline actions)", value = {"script-message-to", mp.get_script_name(), "medios-start-helper"} }) + table.insert(items, { title = "Start Helper", hint = "(pipeline actions)", value = "script-message medios-start-helper" }) end _lua_log('[MENU] Built ' .. #items .. ' menu items')