Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Workaround for "Click at" in Mavericks?

I am running into the limitation of "click at" being broken in Mavericks. At this point (thanks to the help of a user here) I am able to get the first part of my script working which opens a link in Safari (pre-populated Amazon Search link), then clicks on the first result.(Previous post)So now that I am on the details page I need to get various text from the page. The first being the title of the Item. I attempted to modify the solution provided for clicking the link, but I can't get it working.


Seems so simple to just highlight 2 lines of text, and copy to a variable. But with the click at function not working, I don't know how to go about it.


I am hoping Javascipt can save the day again? Below is the element information...


Any help would be greatly appreciated.


User uploaded file

MacBook Pro (15-inch Late 2008)

Posted on Sep 3, 2015 5:07 PM

Reply
4 replies

Sep 4, 2015 5:40 AM in response to AppleScriptQuestions

Hi,


To get the text from an element, you need this javascript : someElement.innerText or someElement.textContent

So, you can use this script

-----------------------------

tell application "Safari"

set productTitle to do JavaScript "document.getElementById('productTitle').innerText" in document 1

-- or --> set productTitle to do JavaScript "document.getElementById('productTitle').textContent" in document 1

end tell

Workaround for "Click at" in Mavericks?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.