Hello
Some things are really bad.
I tested with TextEdit so I was able to run the script with nothing selected : menu item inactive
or with something selected : menu item active
(1) the whose filter is no longer usable. We must use something like that :
tell application "System Events"
set theProcess to (first application process whose frontmost is true)
set theProcess to process "TextEdit"
tell theProcess
tell menu 1 of menu bar item 4 of menu bar 1
#set cutEnabled to (properties of (get first menu item whose value of attribute "AXMenuItemCmdChar" is "X"))
-- Invalid index
set theValues to value of attribute "AXMenuItemCmdChar" of every menu item
set {maybe, cutenabled} to {0, false}
repeat with i from 1 to count theValues
if item i of theValues is "X" then
set maybe to i
exit repeat
end if
end repeat
if maybe = 0 then
# no item whose shortcut letter is X in the menu
else
# test the value of attribute "AXMenuItemCmdModifiers"
tell menu item maybe
properties of every attribute
set cutenabled to value of attribute "AXMenuItemCmdModifiers" is in {1, true}
end tell
end if
end tell
end tell
end tell
In both cases the properties of the attributes of menu item Cut were the same :
{
{value:“AXMenuItem”, class:attribute, settable:false, name:“AXRole”},
{value:“commande de menu”, class:attribute, settable:false, name:“AXRoleDescription”},
{value:menu “Édition” of menu bar item “Édition” of menu bar 1 of application process “TextEdit” of application “System Events”, class:attribute, settable:false, name:“AXParent”},
{value:false, class:attribute, settable:false, name:“AXEnabled”},
{value:{0, 54}, class:attribute, settable:false, name:“AXPosition”},
{value:{298, 19}, class:attribute, settable:false, name:“AXSize”},
{value:“Couper”, class:attribute, settable:false, name:“AXTitle”},
{value:missing value, class:attribute, settable:false, name:“AXHelp”},
{value:false, class:attribute, settable:true, name:“AXSelected”},
{value:“X”, class:attribute, settable:false, name:“AXMenuItemCmdChar”},
{value:missing value, class:attribute, settable:false, name:“AXMenuItemCmdVirtualKey”},
{value:missing value, class:attribute, settable:false, name:“AXMenuItemCmdGlyph”},
{value:false, class:attribute, settable:false, name:“AXMenuItemCmdModifiers”},
{value:missing value, class:attribute, settable:false, name:“AXMenuItemMarkChar”},
{value:missing value, class:attribute, settable:false, name:“AXMenuItemPrimaryUIElement”}}
For sure filing a bug report is needed but as I wrote I am unable to do that since 2013/06/11
Worse, as I wrote here about Mavericks, maybe Apple will ban me from SEEDs :roll eyes:
Yvan KOENIG (VALLAURIS, France) samedi 20 juillet 2013 15:56:59