AutoHotkey menu selection fails in Figma desktop application

I need help with AutoHotkey automation in Figma’s desktop app. The WinMenuSelectItem command doesn’t seem to work at all when I try to navigate menus automatically.

I tested a script that should detect menu clicks and show their positions, but it couldn’t find any menu items. This makes me think Figma’s desktop version might actually be an embedded browser instead of a native Windows application.

Right now I’m stuck using pixel coordinates and mouse clicks, but this approach has problems. It’s slow and breaks completely when I change monitors or screen resolution.

Here’s my current workaround code:

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

^!+q:: ; Navigate to master element
Click 35, 75
Sleep, 150
Click 105, 245
Sleep, 300
Click 315, 480
Sleep, 150
Click 575, 485

CoordMode, Mouse, Screen
MouseMove, (A_ScreenWidth // 2), (A_ScreenHeight // 2)
return

^!+w:: ; Open component plugin
Click 35, 75
Sleep, 150
Click 105, 355
Sleep, 300
Click 320, 550
Sleep, 150

CoordMode, Mouse, Screen
MouseMove, (A_ScreenWidth // 2), (A_ScreenHeight // 2)
return

^!+e:: ; Export prototype URL
Click 2385, 80
Sleep, 300
Click 1125, 520
return

Is there a better way to handle menu automation in Figma without relying on fixed coordinates?

Check out Figma’s web API too. Not exactly what you’re asking for, but you can script actions through their REST endpoints to skip some menu clicking. Won’t cover everything, but exports and component management work well this way - beats dealing with Electron’s janky UI.

electron apps r super tricky! have u tried using accessibility tools like UIA or MSAA? they might help to grab the elements in electron. also, check out window spy from AHK to see if any controls actually show up.

You’re right - Figma desktop runs on Electron, which is basically a web browser in disguise. That’s why normal Windows automation completely breaks. I’d skip the menu clicking entirely and use keyboard shortcuts instead. Figma’s got tons of them and they’re way more reliable. Ctrl+Shift+K for components, Ctrl+Alt+C for copying properties, etc. ImageSearch works pretty well too. Grab screenshots of the menu items you need and search for them. It’s not bulletproof but handles different screen sizes better than hardcoded coordinates. If you’re stuck with coordinates, make them adaptive. Get the window size first, then work with percentages instead of fixed pixels. I always calculate relative positions - saves a ton of headaches when things move around.

Had this exact issue automating design workflows across different machines. Coordinate-based automation is a total nightmare with different setups. Here’s what actually worked: I combined window detection with relative positioning. Use WinGetPos to grab Figma’s window boundaries, then calculate menu positions as percentages instead of absolute coordinates. Key is finding consistent visual anchors in Figma’s interface. Also discovered Figma handles direct keyboard navigation really well once you’re in the right context. Hit Alt to activate the menu bar (works in most Electron apps), then just use arrow keys to navigate. This killed my resolution headaches and works across any monitor setup. Still need to watch timing though - Electron apps can be slow with UI updates.

I’ve encountered similar issues with other Electron apps. Window detection is crucial here. Since Figma lacks proper Windows controls, I recommend using ControlClick with the window handle instead of the raw Click commands. Start by grabbing the window position with WinGetPos, and then calculate your offsets from there—avoid using screen coordinates. One effective method I found was utilizing PostMessage or SendMessage to send key combinations directly to the Figma window, which bypasses the coordinate problems. It’s also worth using UISpy tools to check if any UI elements are detectable. As a last resort, consider running Figma in browser mode where web automation tools function better, although this somewhat undermines the benefits of having a desktop app. Additionally, ensure your DPI settings are correct and adjust coordinates accordingly for window scaling.