Skip to main content
Question

I came up with a method to assign keyboard shortcuts to functions that don’t have them

  • December 19, 2024
  • 0 replies
  • 8 views

Kailous

Some functions that don’t appear in the menu cannot have shortcuts assigned to them. However, I came up with an alternative method. By using the keyboard shortcut Command+K, you can bring up the search box. Once the required function is entered, you can activate it. Then, on macOS, you can use a script to help automate this workflow and trigger it with a single click. Below is the script I wrote for quickly creating multiple components.

tell application "System Events" 
    -- Activate the Figma application
    tell application "Figma" to activate 
    
    -- Simulate the Command + K keyboard shortcut
    keystroke "k" using {command down} 
    delay 0.1 -- Wait for the command panel to appear 
    
    -- Type "创建多个组件" (Create Multiple Components)
    set the clipboard to "Create Multiple Components" -- Use the clipboard to ensure proper Chinese input 
    delay 0.1 -- Ensure clipboard content is set properly 
    keystroke "v" using {command down} -- Paste the clipboard content 
    
    -- Press the Enter key
    delay 0.1 -- Wait for the input to complete
    keystroke return 
end tell

Then, use automation settings to bind the script to a keyboard shortcut or a Touch Bar button, and you’re good to go.

However, I still hope that the official developers can adapt these shortcuts, or at the very least provide a function entry in the system menu to make it easier for users to set shortcuts using third-party tools.

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings