Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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:

share|improve this answer
    
thanks, this solves the problem by a different approach. I didn't get the highlighted part of your answer, could you elaborate? I'm using 1.6.8. –  davka Dec 3 '12 at 11:44
    
You can run it in AppleScript Editor to see the names of the menu items. –  ؘؘؘ Dec 3 '12 at 12:04
    
cool, thanks. the reply is {"Paragraph", " Default", " Left to Right", " Right to Left", missing value, "Selection", " Default", " Left to Right", " Right to Left"} though, so the problem still exists –  davka Dec 3 '12 at 13:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.