Writing a Browser Text Field to a Variable and Clipboard
Hi,
We have an internal system where it stores a value in a read only text field. I want to copy that value into a variable or the clipboard and then reuse it somewhere else.
I tried to find any doc that shows you how to to get a value from javascript and make it a applescript variable. My incorrect code just sets my v to the exec javascript text. I want to get the value from the ElementId P15_ENVIRONMENT_AAI_PASSWORD. Thanks!
tell application "Google Chrome" to tell active tab of window 1
set v to execute javascript "document.getElementById('P15_ENVIRONMENT_AAI_PASSWORD').value"
set the clipboard to v
display dialog (v)
end tell
MacBook Pro (Retina, 13-inch, Late 2013)