UI AppleScript Syntax Group A or Group B

Hi,

I’m hoping that there’s some way to write this so that it’s a single script.

This is working:

tell application "System Events"
	tell process "Logic Pro"
		get value of (every checkbox whose description is "bypass") of (every group whose value of attribute "AXDescription" does not contain "Loudness") of (first UI element whose value of attribute "AXDescription" contains "SUB MASTER") of UI element 2 of group 1 of (first window whose value of attribute "AXTitle" contains " - Mixer: All")
	end tell
end tell

But I’d like to search for 2 possible groups like this (this is not working with error:

"error "System Events got an error: Illegal comparison or logical." number -1726 from "automation" to record"):

tell application "System Events"
	tell process "Logic Pro"
		get value of (every checkbox whose description is "bypass") of (every group whose value of attribute "AXDescription" does not contain "Loudness" or "automation") of (first UI element whose value of attribute "AXDescription" contains "SUB MASTER") of UI element 2 of group 1 of (first window whose value of attribute "AXTitle" contains " - Mixer: All")
	end tell
end tell

– Groups with a description that do not contain either “Loudness” OR “automation” - can be either.

Is there a syntax that will work this way in AppleScript?

Thanks!

Hi @Fredrik71,

Thanks for the idea.

This is actually part of a larger macro with many other Apple and Bash scripts. With this particular script I was just hoping to avoid having to run it multiple times if I can grab all the particular UI Elements that meet these criteria at once. The result will only be a few elements, maybe 2-5 at the most. But AppleScript is slow and then add in the UI scripting and all the other random things I have to do to make sure it works (click an element twice with a delay so that it’s value correctly updates to true or false) and also that this is just one part of a larger macro with other AppleScript etc., so I’m just trying to be efficient.

I’ll look into the class of UI elements.

Thanks