So – trying to press on with icons that keep changing color depending on the video that is playing and therefore make my found image actions prone to failure.
Any work around?
Here some examples of the different colors it gives me:
I was thinking if i could turn all those image into grayscale I would have an easier dealing with this situation.
You can't use grayscale. That's been wished for before but isn't currently possible.
The only thing I can think of for to do is loop through a group of possible images, although you might possibly be able to combine some close variations by adjusting the fuzz factor in the actions.
Do you have to use those images? Is there something else -- corner of the window, another image that doesn't change -- that's a constant offset from the place you want to click that you can use as an anchor?
Thanks u. I also ended up figure that out the hard way last night when I had finally gotten my greyscale function to work and KM wouldn't pick up on the greyscale and just look at the actual color, sad
They colors are always different. I was trying to do a simple function where I enter picture-in-picture more on my browser. Usually YouTube create a custom background based on the content of the video u are watching and the reason where I couldn't hard code the placement of the cursor is because on some other website (mostly Netflix, let me know if u know some more they place the icon at different positions)
Given this is in a browser, and given that there are Chrome extensions that enable PiP by keystroke, it's possible that you could do this with an "Execute JavaScript in Browser" action.
I have no idea how to do this! Just throwing it out there in case it sparks something for somebody else...
An Execute JS in Browser action does have access to the browser's main JS evaluation space, but not, I think, to the separate evaluation space of a Chrome extension.
I'm way, way, out of my depth here and waiting to be shot down in flames -- but don't extensions interact with the browser via JavaScript? The implication being that if an extension can trigger the PiP function then a KM "Execute JavaScript" action could too.
Of course, that could be the naïveté of the ignorant
@ComplexPoint is quite right – by design browser extensions are completely sandboxed from the page-level context Keyboard Maestro has access to, and that safeguard is in place to prevent scripts from doing mischief at the OS level.
Plug-ins also have access to app-level browser features that aren't defined in the JavaScript specification.
However – @MikeTheClicker has demonstrated that magic can happen if you're capable of writing your own browser extension:
Seems like you had the right idea to just go with a Chrome Extension.
Google provides their own extension : Picture-in-Picture Extension
Which literally is the same thing as the browser built in feature but with less options but has a built in keystroke (option+p) to open up picture-in-picture mode.
Sadly ended up not being KM related but thanks for everyones help and ideas.