Greetings, All!
I’m finally rebuilding my life after a horrific accident two years ago and, in theory, only have one more round of head surgery to go. How exciting! I’m diving back into AppleScript and would like to solve two (to start) challenges that I didn’t get to before the accident:
I want to determine if a menu item is selected, i.e. has a check mark to the left of the name, but the property returned is: selected:missing value . For example:
tell application "NoteTaker" to tell the front notebook to tell application "System Events" to tell process "NoteTaker"
return selected of menu item "Cover" of menu "Window" of menu bar item "Window" of menu bar 1
--> returns "" (when called as string) or selected:missing value (when called as property)
end tell
Is there a way to determine if the menu is “checked”?
–
Also, I am calling a menu click, but the menu doesn’t automatically update itself, so it doesn’t register its availability until after the menu is clicked. I can script a mouse movement to click in the menu bar, but is there a more elegant solution? For example:
tell application "Tables" to tell application "System Events" to tell process "Tables"
-- when a column has been selected
if (enabled of menu item "Column" of menu "Insert" of menu bar item "Insert" of menu bar 1) is true ¬
and (enabled of menu item "Row" of menu "Insert" of menu bar item "Insert" of menu bar 1) is false then
click menu item "Column" of menu "Insert" of menu bar item "Insert" of menu bar 1
--> even though a column was selected, it would return false until the menu bar was clicked--anywhere in the menu bar
end if
end tell
I’ve also been trying to see if iKey could figure either out, but in all its glory (and from an old OneClick devotee, thats a lot!) I don’t think that even iKey can figure it out. . . . But then again, without a brain, my skills at code crunching have gone a bit South.
Thank you and Happy New Year!!
Model: B&W G3
AppleScript: 1.9.3
Browser: Firefox 2.0.0.1
Operating System: Mac OS X (10.3.9)