I am trying to get the selected or highlighted text in a web view in my project.
set richText to view "RTE" of window "Edit"
set mainFrame to (call method "mainFrame" of richText)
set dom to (call method "DOMDocument" of mainFrame)
set selText to (call method "selectedDOMRange" of dom)
but I get “The variable selText is not set”. I am missing a step somewhere, but I am not sure where.