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.
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.