View Single Post
Old 27th July 2017, 04:47   #2  |  Link
avih
Capture, Deinterlace
 
avih's Avatar
 
Join Date: Feb 2002
Location: Right there
Posts: 1,971
Quote:
Originally Posted by stax76 View Post
Does anybody know if libmpv supports the OSC?
Not sure. Regardless, I think typically you'd use libmpv to embed the video content in a GUI of your own.

Quote:
I wanted to learn Lua and thought it's nice but then I realized that I would need too much time to learn it. Now I want to try to script the player with JavaScript, does anybody know if I can rename a file or start a process that renames a file?
Lua in mpv has its standard library available - through which you can most probably rename a file (probably via the "io" module).

Both Lua and JS in mpv support "mp.utils.readdir()" and "mp.utils.subprocess" command to execute an arbitrary program with arguments, which you could probably use to rename a file.

JS in mpv also has high level functions for reading and writing (but not deleting) plain text files, so depending on your exact needs, it might be enough.

See https://mpv.io/manual/master/#lua-scripting and https://mpv.io/manual/master/#javascript .
avih is offline   Reply With Quote