Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using of UI element in my script is giving "Expected class name but found identifier." Syntax error

Tags:

applescript

I am very new to apple script, I am trying to get all the UIElements, here is my code

tell application "Myapp"
set visible to true
return every UI element of front window
return name of every UI element of front window
end tell

I got this code from here can anyone please help me to get out of this Note: My OS is OS X El Capitan 10.11.1

like image 787
jithendra k.s Avatar asked Oct 19 '25 14:10

jithendra k.s


1 Answers

You have to ask the process of the app – which System Events knows – for that information.

tell application "System Events"
  tell process "Myapp"
     set visible to true
     return every UI element of front window
     -- return name of every UI element of front window
  end tell 
end tell 

The name of the process can be different from the name of the application

like image 190
vadian Avatar answered Oct 22 '25 03:10

vadian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!