Replies: 1 comment 5 replies
-
mp.observe_property('clipboard/text', 'native', function (_, clipboard)
if clipboard and clipboard:find('^http') and (mp.get_property_native('idle-active') or mp.get_property_native('eof-reached')) then
mp.commandv('loadfile', clipboard)
end
end) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I noticed that we have
I've tried to use it (with AI help), couldn't get it to work as I wanted - which was to monitor the clipboard for any URLs and then paste them into mpv and then bring mpv to foreground
(I use Windows)
So with the help of AI here's the final lua script that does that:
This script works.
But... now that we have property with
clipboard
I kinda need some help to shrink this long script to something more reasonable and efficient, are there any experts on the matter who can help me with that?By the way I tried using PowerShell for some of those functions and it appears that it's a bad idea since it's slow + takes much more CPU usage
Beta Was this translation helpful? Give feedback.
All reactions