Michael Gilbert Posted October 26, 2017 Share Posted October 26, 2017 (edited) I am using Applescript to check if menu item is enabled, e.g. is Obj Info palette checked or unchecked. I can then pass that value to an if-then step. This is what I have tried running: tell application "System Events" tell process "Vectorworks 2017" get value of menu item "Object Info" of menu item "Palettes" of menu "Window" end tell end tell When I run this I am getting error: "System Events got an error: Can’t get menu "Window" of process "Vectorworks 2017". The main menu item is "Window" so anyone know what I am doing wrong? See attached pics Thanks Michael Edited October 26, 2017 by Michael Gilbert Clarify question Quote Link to comment
Pat Stanford Posted October 26, 2017 Share Posted October 26, 2017 The following seems to get what you want. It return the check mark character if it is selected or Missing Value if it is unchecked. If you are going to do much GUI scripting, I strongly recommend that you get a copy of UIBrowser from pfiddlesoft.com. It makes working out this type of code possible if not easy. tell application "System Events" tell application process "Vectorworks 2018" get value of attribute "AXMenuItemMarkChar" of menu item "Object Info" of menu 1 of menu item "Palettes" of menu 1 of menu bar item "Window" of menu bar 1 end tell end tell make sure you remove the - at the line break in the middle of Ob-ject it should all be a single line of code. Ask again if you need more help. Quote Link to comment
Michael Gilbert Posted October 30, 2017 Author Share Posted October 30, 2017 Thanks Pat that combined with Keyboard Maestro enabled me to recreate macros from Quickeys. Much appreciate help. Michael Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.