Answer the question
In order to leave comments, you need to log in
VLC player. How to copy track name to clipboard (lua)?
Hello.
There is a VLC player on MAC OS. But the ability to copy the name of the track of an online radio station is not implemented.
There is a LUA script for writing this information to a file.
-- now_playing / radio
function now_playing_radio()
local item=vlc.item or vlc.input.item()
io.output(vlc.config.userdatadir() .. "/np_radio.txt")
if item:metas()["now_playing"] then
io.write(item:metas()["now_playing"])
else
io.write(item:name())
end
io.close()
end
-- now_playing / radio ClipBoard
function set_clipboard()
local item=vlc.item or vlc.input.item()
io.popen('cbcopy','w')
if item:metas()["now_playing"] then
io.write(item:metas()["now_playing"])
else
io.write(item:name())
end
io.close()
end
-- now_playing / radio ClipBoard
function set_clipboard()
local item=vlc.item or vlc.input.item()
if item:metas()["now_playing"] then
io.popen('pbcopy','w'):write(item:metas()["now_playing"])
else
io.popen('pbcopy','w'):write(item:name())
end
close()
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question