I am trying to execute Javascript in Chrome and then save result as KM variable (the same operation as on the first screenshot) using AppleScript, however, no luck. Getting an error: error "Keyboard Maestro Engine got an error: Can’t make missing value into type text." number -1700 from missing value to text
Thanks for your reply. Just tried plenty of combinations but it still gives me different errors.
Actually, this code worked before (screenshot attached) that is why I cannot get where am using using not proper commands.
Since I am trying to pass the variable to KM via AppleScript it is broken.
Combinations won't help. You must explicity follow the Chome Dictionary.
You're missing the "tab" object.
You need something like this:
set jsStr to "
document.querySelector('div.cooked').innerText;
"
tell application "Google Chrome"
set oTab to active tab of window 1
set scriptResults to execute oTab javascript jsStr
end tell
return scriptResults