Hi,
I am new to this awesome new world of Applescript. I am writing a script that takes me to a web page using Chrome and then then grabs a read only field containing a value. I can’t find how I can write that value that I get via javascript into the clipboard so I can use it in another step in the script.
Here is an example where I tried to set v = result of the value of P15_ENVIRONMENT_AAI_PASSWORD. The dialog just says msng so I am definitely not doing this correctly. I am not much of a programmer and just hacking my way through this. I could find plenty of examples of how to execute javascript through applescript but nothing where I can set the value from the script to a applescript variable.
Thanks!!
tell application “Google Chrome”
activate
open location “https://demo.xxxx.com/apex/f?p=355:15:108494447248756::NO::P15_INSTANCE_NAME:” & (text returned of theResponse)
delay 7
end tell
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)
–execute javascript “document.querySelectorAll(‘.tile-grid .most-visited’)[3].click()”
end tell