Keyboard Shortcut

Hello
Can I do Shortcut for these options from the keyboard?

Yes. Create a new document in your preferred Plaintext Editor (like TextMate, Atom or SublimeText), and paste this in there:

#MenuTitle: Toggle RTL/LTR
# -*- coding: utf-8 -*-
__doc__="""
Toggle frontmost tab between LTR and RTL writing direction.
"""

if Glyphs.font:
    thisTab = Glyphs.font.currentTab
    if thisTab:
        if thisTab.writingDirection() == 0: # LTR
            newDirection = 1 # RTL
        else: # RTL or TTB
            newDirection = 0 # LTR
        thisTab.setWritingDirection_( newDirection )
    else:
        print "ERROR: No Edit tab open. Cannot switch writing direction."
else:
    print "ERROR: No font open. Cannot switch writing direction."

Save it with a .py suffix in the folder Scripts that appears when you choose Script > Open Scripts Folder. Then hold down your Option key and choose Script > Reload Scripts. Your script will now appear in the Script menu. Now, you can give it a keyboard shortcut in System Preferences > Keyboard > Shortcuts > App Shortcuts > Glyphs.

Thank you very much dear
The task has been successfully completed.
Thank you from the heart.

1 Like