Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Oneechan69

macrumors regular
Original poster
Mar 29, 2022
220
29
US
Like, if I have a Firefox window open on a specific tab, the tab's name will appear in the title (which can be seen with dock preview apps like DockMate). I want to be able to set custom window layouts for apps with specific titles (or titles that contain specific phrases) and trigger them with hotkeys.
 

Oneechan69

macrumors regular
Original poster
Mar 29, 2022
220
29
US
I asked Mistral Medium on Poe, about doing it with Hammerspoon and it outputted lua for it. I looked up the HS API real quick to see if looked valid and it did. I haven't tried it yet but will when I have time to really look at Hammerspoon.

@bogdanw What do u think of Hammerspoon, especially for tasks like this? It looks much more appealing since it uses a more normal language (lua) rather than AppleScript which is very unintuitive for just about anyone with programming experience.
 

bogdanw

macrumors 603
Mar 10, 2009
5,734
2,765
@bogdanw What do u think of Hammerspoon, especially for tasks like this?
It’s the first time I hear about Hammerspoon & Lua and for me it seems like an over-complication.
In AppleScript
- to get the name on the front Firefox window
tell application "Firefox" to get the name of front window
- to set the bounds of a Firefox window named “Apple”
tell application "Firefox" to set the bounds of the window "Apple" to {24, 96, 524, 396}
 

Oneechan69

macrumors regular
Original poster
Mar 29, 2022
220
29
US
@bogdanw I'm a little surprised given how active you seem here. tell application "Firefox" to get the name of front window is pretty unintuitive if you know one or a few more common programming languages. What languages do u know?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.