Replies: 2 comments
-
By activating Rectangle in your AppleScript, you're bringing focus to Rectangle rather than the window you are trying to manipulate. There's no ui element / window for Rectangle to grab in this scenario, hence the greyed out items. There are two potential feature requests here, rather than a bug.
Request 1 isn't as trivial as it sounds, since Rectangle uses macOS keybindings (via MASShortcut), and the application is not notified of the down and up of keystrokes. Request 2 has an open enhancement request. It's also a decent amount of work but is something I would be more open to adding in (PR welcome!) Moving this to a discussion since I don't deem this as a bug |
Beta Was this translation helpful? Give feedback.
-
I know this request is a bit old, Keyboard Maestro lets me (somewhat slowly and hackily, but effectively) automate Rectangle, which isn't yet scriptable. I use the Sixths menu, but navigating submenus is meh. Also, I didn't want to dedicate six keyboard shortcuts to a function I don't use that often, so I created a Keyboard Maestro macro that activates the Rectangle menu (by finding its icon in the menu bar and clicking on it), then sends a sequence of arrow keys to navigate the menu. For example, after opening the menu, it sends ↑(x6 to get to "Sixths ►"), then → and ⏎, which selects Top Left Sixth. Similarly ↑(x6), →, ↓(x4), ⏎ selects Bottom Center Sixth. It sounds a lot more complicated than it is, honestly. All of the macros share the same keyboard shortcut. To choose the right one, Keyboard Maestro pops up a little window where you can type one or two characters to select it. By giving them reasonable names like "Top Left Sixth," I can type the shared keyboard shortcut, followed by "TR" for "Top Right" or "BL" for "Bottom Left" and so forth. It's a bit slow because I had to add a 0.25s delay between keystrokes for it to be reliable and repeatable. It works great. Keyboard Maestro's method of disambiguating macros with the same shortcut makes it work. |
Beta Was this translation helpful? Give feedback.
-
macOS version: latest version of mojave 10.14
Rectangle version: Version 0.41 (46) installed via homebrew
Logs if applicable (In Rectangle menu, hold option, "View Logging..."): nothing appears when viewing the logs
coming from spectacle.app as i just found out it is no longer being actively developed removed spectacle.app and installed this app, ie. rectangle.app
i'd like to hold a key sequence down ie. larger and smaller as i move my windows around the screen, sometimes my browser window is small, and i'd like to make it larger, but i have to press the keyboard shortcut i have setup, ie.
⌘+⌥+➕
to make the window larger, and continually have to repeat the keyboard shortcut ie. i can not hold down such keyboard shortcut to make the window larger or smaller.
i thought i'd be clever and attempt to access the menu items from an applescript but most if not all menu items are greyed out when accessing them via an applescript, possibly due to the fact that i don't write applescripts to often, but this what the menu item looks like when running my applescript
i saved my applescript as an app bundle ie. a
.app
and setup a karabiner-elements modification test, ie. holding a key down right alt key which runs my applescript app bundle, but as mentioned in the image most if not all menu items are not accessible.my applescript
Beta Was this translation helpful? Give feedback.
All reactions