El Cap returns no value for "AXSelectedText"

i enjoyed already to see Preview in El Cap with scriptability, but then i realized that the dictionary there is so damn poor to be unusable, like it wouldn’t even exist. Thats not funny, absolutely not funny, but it gets worse.

At this point i thought to go back and use System events and ui elements once again, but even here we get a bad surprise: my older code doesn’t work anymore. Hate this.but there must be a way to access the content of the attribute -AXSelectedText-, which corresponds to a selected text in a pdf in Preview, for example.

I really need your assistance, as it is an urgent and important question for me. Some code to start with:

tell application "System Events"
	tell static text of window 1 of process "Preview"
		#properties of attribute "AXValue" #"AXSelectedText"
 		set ff to value of (properties of attribute "AXSelectedText" as record)
 		return ff

		set all_attr to item 1 of (get name of attributes)
		repeat with a in all_attr
			set dd to value of (properties of attribute a as record)
			log dd
		end repeat
 	end tell
end tell

I commented your script after making some required changes.

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell window 1
		class of every UI element
		log result (*splitter group, button, button, button, toolbar, image, menu button, static text*)
		properties of first static text
		log result (*class:static text, minimum value:missing value, orientation:missing value, position:1970, 489, role description:texte, accessibility description:missing value, focused:false, title:missing value, size:326, 17, value:Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157), help:missing value, enabled:true, maximum value:missing value, role:AXStaticText, entire contents:, subrole:missing value, selected:missing value, name:Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157), description:texte*)
		attributes of first static text
		log result (*attribute AXFocused of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXFrame of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXSelectedText of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXAuditIssues of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXInsertionPointLineNumber of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXPosition of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXNumberOfCharacters of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXEnabled of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXPlaceholderValue of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXSelectedTextRange of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXHelp of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXChildren of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXRole of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXParent of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXTopLevelUIElement of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXVisibleCharacterRange of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXValue of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXSize of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXRoleDescription of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview, attribute AXWindow of static text Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of window Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157) of application process Preview*)
		value of attribute "AXValue" of first static text
		log result (*Everyday AppleScriptObjC 3ed.pdf (page 30 sur 157)*)
		value of attribute "AXSelectedText" of first static text
		log result (*missing value*)
		-- (which is logical because we can't select the title of the window)
		tell first static text -- of window 1we are already speaking to window 1
			#properties of attribute "AXValue" #"AXSelectedText"
			(properties of attribute "AXSelectedText" as record)
			log result (*class:attribute, value:missing value, settable:false, name:AXSelectedText*)
			set ff to value of (properties of attribute "AXSelectedText" as record)
			log ff (*missing value*)
			set all_attr to item 1 of (get name of attributes)
			log result (*AXFocused*)
			-- Now, as all_attr is a string you are looping upon the letters of the string : A, X, S, .
			repeat with a in all_attr
				log a (*A*)
				set dd to value of (properties of attribute a as record)
				log dd
			end repeat
		end tell
	end tell
end tell

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) samedi 19 décembre 2015 11:25:36

Don’t know what impression my script made, but im not confused on how the parsing process should look like. Previous to El Cap, i used with success:

tell static text of scroll area 1 of splitter group 1 of window 1 of process "Preview"
	set sel_txt to value of (properties of attribute "AXSelectedText" as record)
end

I upgraded only recently to El Cap and saw some of my scripts broken, so i tried to modernize my older code, with success. But the “AXSelectedText” wasted some of my time and made me go mad. Anyway, you used in your posting:

žtell first static text ž instead of a generic call as i used. Because of this explicit call, you need no more:
žset all_attr to item 1 of (get name of attributes)" but only: žset all_attr to (get name of attributes)", and the loop works again, which is only a utility to check properties, and has less to do with my script.
I wanted to know how to get the attribute “AXSelectedText” and enough.

Long story, short meaning: i appreciate your post (i checked a lot of your UI scripts over the years - and they are useful and well made), but the result you suggest here (i tested your script) gives me still the same results - the value of “AXSelectedText” stays hidden.

Probably there is nothing we can do ”and i hate saying this” or have you some another opinion, workaround ?

Assuming that the static text you ask about in your second message really exists, every informations required to get its AXSelectedText value was available. Written in a single instruction it would be.

tell application "System Events" to tell process "Preview"
	set frontmost to true
	# Here I assume that the static text is available
	tell static text 1 of scroll area 1 of splitter group 1 of window 1
		set sel_txt to value of attribute "AXSelectedText"
	end tell
end tell

But for user which aren’t at ease with GUI scripting, it’s safer to split the instruction as I did in my late message because the split code give the ability to navigate carefully in the structure of the GUI.
In my late message, as the code was split in single instructions, I was able to log their results.

Just to be precise, in your second message you aren’t asking about the same static text that the one asked about in your the one opening this thread !
The static text asked about in message #1 is really available.
The one which you ask about now doesn’t exist.
As I am curious and pig headed, even when the asker prove to be unable to describe correctly its problem I dig in the GUI trying to find the target object, and sometimes I get it.
It’s the case today but the static text is not in the described scroll area and it is deeper in the GUI hierachy.

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell window 1 # with a PDF file open and some words selected
		class of every UI element
		log result (*splitter group, button, button, button, toolbar, image, menu button, static text*)
		class of UI elements of first splitter group
		log result (*scroll area, splitter, scroll area*)
		class of every UI element of first scroll area of first splitter group
		# Here there is no static text
		log result (*UI element, scroll bar*)
		# Try deeper
		class of every UI element of first UI element of first scroll area of first splitter group
		log result (*image, image, image, image*)
		# Nada !

		# Try in the other scroll area
		class of every UI element of scroll area 2 of first splitter group
		# Here there is no static text
		log result (*group, scroll bar*)
		# try deeper in the hierarchy
		class of every UI element of first group of scroll area 2 of first splitter group
		log result (*static text*)
		# BINGO, it's here !
		tell first static text of first group of scroll area 2 of first splitter group
			its value
			log result (*How to Make a Bootable
OS X El Capitan Beta USB
Installer Drive
Jun 11, 2015 - 43 Comments
Many Mac users interested in running OS X El Capitan may wish to have a bootable install drive of the new operating system. We're going to demonstrate how to do this with a USB flash drive, but*)
			name of its attributes
			log result (*AXSelectedTextRange, AXEnabled, AXDescription, AXParent, AXSize, AXFocused, AXRole, AXTopLevelUIElement, AXPosition, AXTitle, AXValue, AXWindow, AXRoleDescription, AXVisibleCharacterRange, AXSelectedText, AXFrame*)
			set sel_txt to value of its attribute "AXSelectedText"
			log sel_txt (*OS X El Capitan Beta USB*)
		end tell
	end tell
end tell

Of course, if nothing is selected in the text, the value sel_txt will be set to missing value !

Next time, try to define precisely and exactly your problem. It would spare your time and mine.

When the hunt prove to be successful, and only in such case, it’s quite reasonable to try to write a compact code. Here it would be :

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell first static text of first group of scroll area 2 of first splitter group of window 1
		set sel_txt to value of its attribute "AXSelectedText"
		log sel_txt (*OS X El Capitan Beta USB*)
	end tell
end tell

But without the step by step first one we would always be scrapping our head.

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) samedi 19 décembre 2015 23:31:23

Hey Joy,

My script is just about the same as Yvan’s. (There are only differences in style “ not the technical workings of it.)


tell application "System Events"
	tell application process "Preview"
		tell (first window whose subrole is "AXStandardWindow")
			tell static text of group 1 of scroll area 2 of splitter group 1
				set mySelectedText to value of attribute "AXSelectedText"
			end tell
		end tell
	end tell
end tell

He took a more forensic approach than I did “ I just used UI Browser and my experience with UI scripting to muddle through.

http://pfiddlesoft.com/uibrowser/

If you want a more scriptable PDF viewer I suggest you try Skim.

http://skim-app.sourceforge.net


tell application "Skim"
	tell front document
		set selectedText to selection
		if length of selectedText = 1 then
			set selectedText to (get text for (item 1 of selectedText)) as text
		end if
	end tell
end tell


Chris


{ MacBookPro6,1 · 2.66 GHz Intel Core i7 · 8GB RAM · OSX 10.11.2 }
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Yvan, we all try to share the same interest here on macscripter: to script effective scripts, to share and inspirate.
Its no good habit to say people in their face “Next time, try to define precisely and exactly your problem. It would spare your time and mine.” as It sounds too authoritative as if you would speak to children.

As afore mentioned, i migrated only recently to El Cap and several things changed, not only the GUI of applications. I got the attribute “AXSelectedText” before, with success, and now the same doesnt work anymore. So, i did experiments to see where the “AXSelectedText” is stored now, because now eveything should be “better” with the new OS. Or how many “AXSelectedText” exist ?

and if you state “The one which you ask about now doesn’t exist.” you are right, but only because of the new OS. Im not kidding.

“Of course, if nothing is selected in the text, the value sel_txt will be set to missing value !” again, you are right because of the new Os. Do you seriously think i forget to select text before i run my script ? i code not only 2 minutes

In future, avoid such comments or dont post again. I already said that i appreciate your scripting skills, but you gave me some overscrewed answers. You feel not at your peace if somebody praises you. Dont get me wrong, not everybody want to hurt you (.)

Hello Chris

Taking care to target an AXStandardWindow is a good point.
It take care of the fact that an inspector may be open which is an AXSystemFloatingWindow.
In fact I never opened one before reading your message.
I’m wondering if there may be other non Standard windows open when Preview is at work.

I had to explicitly set frontmost to true to get the script seeing the floating window.

I know UIBrowser but, as I just play with Applescript, I’m reluctant to spend $55 just to be able to help more easily askers.
When I tested a trial version of UIBrowser I discovered that it build code triggering UI elements by their name.
From my point of view it’s a bad choice which make scripts location dependent.
I guess that it’s because English is not my main language that I refuse this kind of code and why I am angry against developers (Apple being the 1st one of course) which don’t insert the name of UI elements in the localizable strings resource.
From time to time I use the brave old Accessibility Inspector but my preferred scheme is to escalade the UI hierarchy which give me the ability to trigger items by their indexes. Sometimes it’s a bit fancy because indexes may change when the system evolve. It’s why I have one script in which an index may take three different values if it’s used under 10.8, 10.9 or 10.10.

May I add that I’m really bored to see that Preview, an application whose role is important in the OS X package, has an AppleScript support lower than Skim, a third party one whose developers have less bucks available to do their job.

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) dimanche 20 décembre 2015 14:53:47

Hello Joy

The point was not that I assumed that you didn’t selected a chunk of text.
It was that in your first message you asked about a static text at the first level of the GUI hierarchy:
tell static text of window 1 of process “Preview”

Then, in your second message, it became a static text described as:
tell static text of scroll area 1 of splitter group 1 of window 1 of process “Preview”
although there is no such item.

In fact, your problem was not to be able to extract the selected component of a static text, it was to address the static text where it really is. Once the addressing was correct, the problem was solved.
The code extracting the AXSelectedText of a static text is/was available in my very first message.
What was missing was the address of the static text you wanted to target.
I took care to detail every instruction to show how we may get the useful parameters
I will be glad to read in which system you got Preview delivering the text content of a PDF at one of the locations which you gave.
In fact I’m quite sure that you never had a script extracting the wanted selected piece of text because none of the instructions which you posted to “speak” to a static text item are correct.
tell static text of window 1 of process “Preview”
and
tell static text of scroll area 1 of splitter group 1 of window 1 of process “Preview”
are incorrect.
Correct instructions would be :
tell static text 1 of window 1 of process “Preview”
and
tell static text 1 of scroll area 1 of splitter group 1 of window 1 of process “Preview”
Of course, the index may be different than 1 but it must always be given.
Even when there is a single object of this kind available at a GUI level, we MUST trigger it with an index.

As I’m not a sooth sayer, it what not guaranteed that, according to your messages, you were really wanting to get the selected component of the PDF text body.
After all, there is a static text at first level, it’s the title of the window.
When you ask a question, I know that you know what you are asking about but potential helpers aren’t behind you and don’t have the informations that you have.
So, even if you feel that it’s unpleasant, I will continue to write - using my old scholar English - that askers would be fair to describe precisely and accurately their problem to spare their time and helpers one.

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) dimanche 20 décembre 2015 15:22:30

Thanks Chris, you made my day!! :smiley:
i could make a comparison thanks your input

tell application "System Events"
	
	#El Cap 10.11.1 --tested, working code
	tell static text of group 1 of scroll area 2 of splitter group 1 of window 1 of process "Preview"
		set mySelectedText to value of attribute "AXSelectedText"
	end tell
	
	return mySelectedText
	#Lion 10.7.5 --tested, working code
	tell static text of scroll area 1 of splitter group 1 of window 1 of process "Preview"
		set mySelectedText to value of attribute "AXSelectedText"
	end tell
end tell

Yvan, all right. The reason why my code didn’t work for you was because of the Os differences, i made a big jump from 10.7.5 to 10.11.1. And there is gone a lot of time between both Os.

In fact, your problem was not to be able to extract the selected component of a static text, it was to address the static text where it really is.

I’m still confused why i got a static text with my first message. The value i searched was nested much deeper, and similar to my older code, but with small differences, like in the comparison above. I can’t than conclude that there are multiple “AXSelectedText” attributes, as strange this may sound.

Even when there is a single object of this kind available at a GUI level, we MUST trigger it with an index.

i personally like generic calls, because you can’t go wrong - and specifiy later what you need, i like to keep things open
i remember you testing also another code i wrote for 10.7.5, which messed up your icon view, only recently (See link below). Sorry about that, but what icon preferences do you use, manually sorting ?
I used that script all the time together with hot corners to inspect nicely! images. And i wonder if there isn’t a modern way to make this useful piece of code running again. :wink:

http://macscripter.net/viewtopic.php?id=44484

(1) I continue to be skeptical about the instruction :
tell static text of scroll area 1 of splitter group 1 of window 1 of process “Preview”
supposed to work under 10.7.5.
As far as I remember, it was always required to pass the index of the UI element, so I’m quite sure that the code must be :
tell static text 1 of scroll area 1 of splitter group 1 of window 1 of process “Preview”
or
tell first static text of scroll area 1 of splitter group 1 of window 1 of process “Preview”

Alas, I no longer have a machine able to run the old beast which is named 10.7.5 so I can’t test.

(2) about your question about an other thread. Nothing changed since 2015/12/01
Running the script entirely messed my window. As I am an old ape, I carefully took a screenshot before running the script so I will be able to reset the original state quite easily.
I never ask the finder to arrange my icons according to its rules. I just urge it to align them to the grid.
I guess that it’s why I got such a mess.

If you rely upon Finder organizing your icons by this or that criteria, try to close the window then open it after executing the script. Here I had to do that to discover the awful mess.

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) dimanche 20 décembre 2015 20:49:46

As I wrote, I can’t test under 10.7.5 but borrowing my daughter’s iBook I was able to test under 10.4.11

The location of the static text in the hierarchy is not the one described for 10.7.5 but it’s not the question here.

tell application "System Events"
   tell application process "Preview"
       tell (first window whose subrole is "AXStandardWindow")
           tell static text of scroll area 1
               set mySelectedText to value of attribute "AXSelectedText"
           end tell
       end tell
   end tell
end tell

refused to compile. The script compiled and worked flawlessly after inserting the index 1 which, since the beginning, I described as required.

tell application "System Events"
   tell application process "Preview"
       tell (first window whose subrole is "AXStandardWindow")
           tell static text 1 of scroll area 1
               set mySelectedText to value of attribute "AXSelectedText"
           end tell
       end tell
   end tell
end tell

So, now I’m sure that under 10.4.11, 10.9.x, 10.10.x and 10.11.x inserting the static text index is required.
Would be glad to read how the script behave under 10.5.x, 10.6.x, 10.7.x, 10.8.x but I’m sure that it requires the static text index in all cases.

I perfectly know what I mean when I write that I am pig headed. Nobody was able to force me to say that an umbrella is useless when it rains. In real life I give an other example but this forum is not dedicated to this kind of subject.

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) dimanche 20 décembre 2015 21:24:24

When we drive Preview with AppleScript, we are not sure of the number of scroll areas available because the user is free to disable the one supposed to display the thumbnails.
Here is an enhanced version taking care of that.

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell (first window whose subrole is "AXStandardWindow")
		tell first static text of first group of scroll area (count scroll areas) of first splitter group
			set sel_txt to value of its attribute "AXSelectedText"
			(*Everyday AppleScriptObjC is © 2013“15 Shane Stanley. Not to be reproduced without written permission.*)
		end tell
	end tell
end tell

It may be shorten as :

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell (first window whose subrole is "AXStandardWindow")
		tell first static text of first group of scroll area -1 of first splitter group
			set sel_txt to value of its attribute "AXSelectedText"
			(*Everyday AppleScriptObjC is © 2013“15 Shane Stanley. Not to be reproduced without written permission.*)
		end tell
	end tell
end tell

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) lundi 21 décembre 2015 10:36:18

no, im not sceptical what you say, its rather the other way around. How often do i need to say you are a good scripter ?
:smiley:
Hey, its easy to get confused with similar code, because values arent always that nested. Both comparisons i posted in my last post, work - i have two machines and could do both tests, with success - if you care to read, i added a comment to the code which says: --tested, working code

Btw, im going to update the icon-script i told you before, now it works again, this time even under El Cap.

I’m really not interested by comments about my efficiency as a scripter.

What I was skeptical about the fact that in all your messages you missed to insert the value of the static text index.
My memory was right, with old systems, without the index, the script refused to compile.
What I don’t know is which system allowed us for the first time to write an instruction without the index when there is a single static text.
In fact it’s not a consistent behavior. In the Preview window there is a single splitter group but if we don’t insert its index in the instruction, the script will not compile.
Yes, under 10.11.2 you may compile an instruction without inserting the index of a static text item when there is only one but it may be done only in an instruction targetting several objects.
tell static text of first group of scroll area -1 of first splitter group
.
is valid.
tell first splitter group
tell static text of first group of scroll area -1
.
is valid too.
tell first group of scroll area -1 of first splitter group
tell static text
.
is not which doesn’t compile.

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) lundi 21 décembre 2015 13:32:49

:rolleyes:

another Os, -Sierra (10.12.3)- new issues. This time the support to fetch “AXSelectedText” seems definitely broken.

I no longer have Sierra 10.12.3.
With 10.12.5 the UI structure of a Preview page is reported differently.
The script below returns what was returned by my late proposal.

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell (first window whose subrole is "AXStandardWindow")
		--tell first static text of first group of scroll area -1 of first splitter group
		tell scroll area -1 of first splitter group
			class of UI elements
			--> {static text, scroll bar, scroll bar}
			tell static text 1
				set sel_txt to value of its attribute "AXSelectedText"
				(*Everyday AppleScriptObjC is © 2013“15 Shane Stanley. Not to be reproduced without written permission.*)
			end tell
		end tell
	end tell
end tell

The compact code would be :

tell application "System Events" to tell process "Preview"
	set frontmost to true
	tell (first window whose subrole is "AXStandardWindow")
		tell static text 1 of scroll area -1 of first splitter group
			set sel_txt to value of its attribute "AXSelectedText"
			(*Everyday AppleScriptObjC is © 2013“15 Shane Stanley. Not to be reproduced without written permission.*)
		end tell
	end tell
end tell

A well known feature of GUI scripting is that Apple is free to change the structure of the GUI with no advice.
Here, nothing is “broken”, something just changed.
I have some scripts which trigger a seemingly stable item (a print dialog) which in fact apply to different internal GUI structure according to the system in use.
It’s our duty to take care of that as long as we use GUI Scripting.

Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) jeudi 18 mai 2017 10:17:52

Thanks very kind, Yvan!
in part my fault if I can’t realise the right syntax - the UIElementInspector is simply outdated to work with. Maybe no bad idea to enrol in some online Course about coding, after all the years of exploring. :wink:
pity to drop coding

I used the old UIInspector (version 3.0) to get the structure of the GUI.
Yes, it’s the old version. The new one is awful.

I was a bit surprised when I saw that it returned only
application
window
splitter group
scroll area.

As I am curious, I asked the script to return the class of the UI elements available in the scroll area.
It returned :
→ {static text, scroll bar, scroll bar}
so it was clear that the selection was a part of the static text and it was easy to add the required code.

Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) vendredi 19 mai 2017 11:09:20