Skip to content

Instantly share code, notes, and snippets.

@Sneakpeakcss
Sneakpeakcss / open-in-explorer.lua
Last active November 21, 2023 15:14
mpv player script to open directory and select currently playing file (Windows).
-- open-in-explorer.lua
mp.add_key_binding(nil, "open-in-explorer", function()
local path = mp.get_property("path")
if path ~= nil and not path:match("^%a[%a%d-_]+://") then
path = string.gsub(path, "/", "\\")
mp.command_native({
name = "subprocess",
playback_only = false,
args = { 'explorer', '/select,', path .. ' ' },