I was wrong.
The code was testing the availability of a shortcut.
tell application "System Events"
tell (first application process whose frontmost is true) -- Or a named, frontmost process.
tell menu 1 of menu bar item 4 of menu bar 1
set nbMenuItem to count every menu item
set liste to {}
repeat with i from 1 to nbMenuItem
set mName to get name of menu item i
try
mName
on error
set mName to missing value
end try
set mAttr to get value of attribute "AXMenuItemCmdChar" of menu item i
try
mAttr
on error
set mAttr to missing value
end try
set end of liste to {mName, mAttr}
end repeat
end tell
end tell
end tell
liste
--> {{"Annuler", "Z"}, {"Rétablir", "Z"}, {missing value, missing value}, {"Couper", "X"}, {"Copier", "C"}, {"Coller", "V"}, {"Coller et appliquer le style actuel", "V"}, {"Coller une référence", "V"}, {"Supprimer", missing value}, {"Tout sélectionner", "A"}, {missing value, missing value}, {"Copier le style", "C"}, {"Coller le style", "V"}, {missing value, missing value}, {"Compléter", missing value}, {missing value, missing value}, {"Rechercher", missing value}, {"Orthographe", missing value}, {"Parole", missing value}, {missing value, missing value}, {"Démarrer Dictée", missing value}, {"Caractères spéciaux.", "T"}}
Yvan KOENIG (VALLAURIS, France) mercredi 20 février 2013 17:17:11