Hello,
I would like hover over an HTML element and trigger a macro that would capture the element's "Copy Selector" and "Copy XPath" values.
I created a macro to try capture the "Copy Selector" value for "I'm Feeling Lucky" button. But the macro is behaving strangely and I'm not sure why.
In the video, first, I manually captured the "Copy Selector" value, then pasted it into a BBEdit note. This is the correct "Copy Selector" value.
Then, I tried to do the same thing using the macro, "Z_TEST Copy Selector using KM". The macro displayed the value for NamedClipboard copySelector, but the value is different from the value captured manually.
Now, for the strange behavior. In the macro, if I enable 'Display Text “From System Clipboard:…” in Window' (highlighted in orange), then the macro will capture the "Copy Selector" value correctly. (same as the manual process). If I disable 'Display Text “From System Clipboard:…” in Window' (highlighted in orange), then the "Copy Selector" value will be different from the value captured manually.
So, I'm not sure why enabling/disabling the action to display the system clipboard value would change the result of the NamedClipboard copySelector value. I'm so confused here.
Hoping someone knows of a better way to automate capturing an element's "Copy Selector" and "Copy XPath" values.
Any help is appreciated,
ChrisQ
Z_TEST Copy Selector using KM Macro (v10.2)
Z_TEST Copy Selector using KM.kmmacros (8.4 KB)