I’m trying to use AppleScript in an automator workflow to get text from a window that I just opened via the same AppleScript.
Essentially here is what is happening with the script:
- Script is called using a keystroke with text selected
- Script gets open application and executes command+0 to open a file (in this case a patient chart in proprietary patient management software) then command+L to create a letter. New window with letter pops open correctly.
- This letter window contains an element that I cannot seem to get to with AppleScript. Ideally I would like to capture the value contained in this element (in this case the url https://some.website.somewhere/indext.html?var=value… ) and then subsequently open the URL in Safari.
This element is a text area (dashed line around the outside). When double clicking on it then inspecting it with Accessibility inspector it is AxTextArea and I’m trying to get the Value property which contains the string/URL
I’ve tried scroll area 1 of window 1 but from there I don’t know how to access this element.
Any ideas? Sorry, new user, it won’t let me post more than one image at a time so I took a combined screenshot.

