How to find out the submenu item’s name in this special case (for a shortcut)

keyboardtextedit

In TextEdit there is this submenu (see the image) that I want to define a shortcut for.
I can't define a shortcut for the "Right to Left" item, I assume it's because there are actually 2 such items in the submenu, under different sections. So how do I uniquely identify this item? Thanks.

enter image description here

Best Answer

The indented menu items start with tabs, but there are still two of them.

tell application "System Events" to tell process "TextEdit" to name of menu items of menu 1 of menu item "Writing Direction" of menu 1 of menu item "Text" of menu "Format" of menu bar 1

You can specify some shortcuts like Format->Indentation->Increase in 10.8 (or >Format>Indentation>Increase in 10.7), but it doesn't help in this case.

You can enable shortcuts for changing writing direction in System Preferences: