Pixelmator with boolean operations

Sometimes its not possible to access specific function with AppleScript directly but
we could use GUI Scripting if the function is access from the menu as this example.

We could also make Accessibility Control Panel to be showing for the specific
target application. In this example I made 4 buttons to include boolean operations
in Pixelmator Pro. So in other words its possible to have custom toolbar for specific
commands to make the working flow more dynamic.

Other way is to use OSC Panels on mobile device to execute commands from OSC
to Midi. And have a background process to listen to midi note to execute AppleScript commands.



* GUI Scripting [menuFormatShapeBy:(string)]
* Description: Boolean operation of current selected layer. 
*	[Unite Shapes], [Subtract Shapes], [Intersect Shapes] or [Exclude Shapes]

-- my menuFormatShapeBy:"Exclude Shapes"
on menuFormatShapeBy:_menuItemString
	tell application "System Events" to tell application process "Pixelmator Pro"
		set frontmost to true
		if (_menuItemString is in {"Unite Shapes", "Subtract Shapes", "Intersect Shapes", "Exclude Shapes"}) then
			tell menu bar 1 to tell menu bar item "Format"
				tell menu 1 to tell menu item "Shape"
					tell menu 1
						click menu item _menuItemString
					end tell
				end tell
			end tell
			set errorLog to "Check if the boolean operation string is correct."
			error errorLog number -128
		end if
	end tell
end menuFormatShapeBy: