I’m trying to make a script that will just place a vertical guideline where the mouse is (and set the correct italic angle of the guideline according to the italic angle). But I cant figure out how to get the x, y of the mouse in this way, whats the correct method?
I should clarify I want go make an actual guideline. Not just draw a line at the mouse. I want to make a script so I can make a shortcut to make a guideline that’s already italicissd at the mouse position.
Since G2 already does add a guideline at the mouse position, just ask Georg to add a modifier key to set it to the italic angle when the guide is added. No need for a script then.
Hi! I’m trying to get the current cursor position from a script, which I run with a shortcut via Better Touch Tool, but instead of the actual mouse position, the code (below) returns the bottom left corner. Doing the same with the regular macOS shortcuts works correctly, so obviously BTT messes it up. I wonder if that can be somehow fixed, perhaps I can update something in the script before requesting the cursor? I see there’s graphicView.cursorUpdate_() but no idea what’s the argument.
BTT otherwise doesn’t cause any problems with the cursor, MOUSEMOVED works fine, so I assume the script misses the updated position, right?
For some reason running print(Glyphs.currentEvent()) via a BTT shortcut returns None. Is it possible to create that event from the code? Perhaps, trigger MOUSEMOVED or something like that?