so, i have learned how to FILL web forms with javascript using applescript, but now i need to know if i can have applescript PULL the data that is currently in a cell on a form? i’m using chrome to pull open a page, select an option from a drop down menu, and when the option is selected, one of the fields on the page is automatically filled in with information. i need my applescript to check the value of that field to see if it matches with another variable. any idea on how to get that data? i know i can input the data by using:
A lot of things seem simple after the fact, so don’t feel stupid “ just learn from it.
Keep in mind that fields in a webpage may or may not be forms.
# Using the search field on http://www.macupdate.com
tell application "Safari"
tell document 1
# Set
do JavaScript "document.getElementById('search_q').value = 'Find Any File'"
# Get
do JavaScript "document.getElementById('search_q').value"
end tell
end tell