I know how to create a shortcut; it is described on Apple website here. However, I came across a tricky case: I want to create a shortcut for the TextEdit application, particularly for setting the writing direction to Right to Left. The hierarchy for this is shown below:

I think that the problem is with the Paragraph word written in grey.

I've tried

Format->Text->Writing Direction->Right to Left


Format->Text->Writing Direction->Paragraph->Right to Left

and others, but none have worked.

How can I solve this issue?

  • -> jumps into a sub menu, but Paragraph is not a sub menu. There does seem to be some visual division there, but I I'm fairly sure that Paragraph and Selection are just greyed out (disabled) and the other items in that list just have extra space (maybe a tab) in front to give indentation. I think you may need Applescript to do this. Clicking deep sub menus with applescript is pretty tedious, but you can click menu items based on the index.
    – Joonas
    Sep 26, 2017 at 12:33
  • I'm terms of indexes, I'm thinking the "path" is something like: item 5 > item 2 > item 5 > item 4. I could be wrong.
    – Joonas
    Sep 26, 2017 at 12:40
  • @Joonas, While one could AppleScript this, it isn't necessary to accomplish the task. See my answer to this question for details. Sep 26, 2017 at 13:12

1 Answer 1


It doesn't matter that it's a command on a nested menu. Just create a proper entry, and in this case for the Right to Left command under Paragraph, it's:

'   Right to Left'

Without the single quotes and that's a leading tab space in front of Right to Left.

Note: You will need to copy and paste the ' Right to Left' (without the quotes from a text source other then this answer because AD converts tab characters to space characters), as you cannot key press a tab when creating the entry.

Here are some screenshots from my system:

System Preferences > Keyboard > Shortcuts

TextEdit Format Menu

Note: For the Right to Left command under Selection there are two leading tab spaces, e.g. (without the quotes):

'       Right to Left'

The quotes in both examples are there to show there is leading tab space in front of the actual command names, although note that AD converts tab characters to space characters in these examples.

  • Great! It worked. However, for someone who will use this in the future, note that when I copied the menu item name from this answer, it didn't work because spaces -not a tab character- were copied. So, I wrote a tab character in TextEdit and copied it.
    – ammar
    Sep 26, 2017 at 13:38
  • Can I ask how did you figure out the solution?
    – ammar
    Sep 26, 2017 at 13:39
  • 1
    @ammarx, You asked "Can I ask how did you figure out the solution?", yes I used Xcode's Accessibility Inspector to copy and paste the value of the target menu command(s). Sep 26, 2017 at 13:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .