Solution for JXA:
var sProc = "ScreenFlow"
var system = Application('System Events')
var elements = system.processes[sProc].windows[0].entireContents()
var s = ""
for (var i=0;i<elements.length;i++){
s = s + elements[i].name() + ","
}
s = s.replace(/null,/g,"")
console.log(s)
There are probably other children that you can add to make this list more dense. Example output from my video editor:
"Video,+ Action,Color:,Offset:,Blur Size,Shadow,Opacity,Scale:,Z Rotation:,Reflection,Y Rotation:,Opacity:,Cropping,X Rotation:,Position:,Color Controls,Corner Round:,Video Filters,Duration: 1 min 0 secs,UI Mass Email App,UI Mass Email App,"
Please note that this does not capture menu text. For this you have to go throughsystem.processes[sProc].menuBars
source
share