r/MacOS • u/Ok-Rest-5321 App Downloader • Feb 28 '26
Creative Today I discovered how powerful Applescripts were.
In the video below I used Gemini to create 7 apple scripts:
- Left Half
- Right Half
- First third
- Center Third
- Last Third
- Maximize
- Almost Maximize
I am using Alfred 5 free version and you can enable apple script launch from its preferences under File Search > Advanced > Run Applescript instead of opening.
I think this is really useful to extend Alfred features for free and also get features that are in other launchers like Raycast and is pretty efficient for window management and also you can basically get any preset or layout unlike raycast which limits custom layouts in its pro tier
4
u/roycetech Feb 28 '26
Do you mind sharing one of the scripts? I’m impressed at the speed. I’d like to try Alfred with AppleScript. I’m a keyboard maestro user
30
u/dekimqc Feb 28 '26
Nice, but consider switching to https://rectangleapp.com/ !
21
u/varodonaire Feb 28 '26
AppleScript is both amazingly powerful and frustrating
10
u/ceesaxp Feb 28 '26
What’s sad is that many apps stopped providing any hooks/dictionaries, making it a lot less powerful (or even more frustrating if one has to emulate going through menu items and dialogue fields)
1
u/SourceScope Mar 01 '26
Should make the command shorter
Like LH or RH etc
1
u/downtownrob Mar 01 '26
I just want windows to cascade… anyone find any app or magic script to do that?
2
u/msephton Mar 01 '26
I have set up similar using Hammerspoon which allows scripts written in Lua. Global hotkeys to push windows into halves, thirds, quarters, onto other displays. Plus triggers when I plug/unplug devices (eg. change dock to right side when my external monitor is connected).
2
u/oblivic90 Mar 01 '26
Wait until you discover hammerspoon
1
u/[deleted] Feb 28 '26
Nice work! I wonder if the same functionality could be replicated in Shortcuts. I’m more of a Shortcuts user myself, but there are instances where Shortcuts simply can’t match the capabilities of AppleScript. Despite this, both tools are incredibly powerful, and their combined use is even more so.
1
u/roycetech Feb 28 '26
Nice. I’ve used a combination of AppleScripts and a paid 3rd party for my window management needs. I just wished I can make my on-demand AppleScripts to run faster. Right now they complete in 1-2s.
1
u/FriendlyStory7 Mar 01 '26
For me the biggest problems AppleScripts it is that I haven’t found a place to learn it. Or to at least read proper documentation.
1
u/AnotherTechAtWork Mar 02 '26
Applescript is certainly useful but don't forget about Shortcuts. There already exists Resize Window and Move Window actions. Any Shortcuts created can easily be ran by Spotlight as well as Alfred and other such launchers.
1
u/TheKubesStore Mar 05 '26
Or I mean you could just use BTT with swipe gestures. I have mine set to 3 finger swipe left for 50% left window, 3 finger swipe right for 50% right window, 3 finger swipe down to minimize app, 3 finger swipe up to maximize app, 3 finger spread to quit current app, 3 finger pinch to open LaunchOS.
0
u/Key-Fall-3758 Mar 01 '26
All this comes for free When using Raycast😎
0
u/mikeinnsw Feb 28 '26
All of AI scraped(Read) open source and accessible GitHub (Google It)
You can access GitHub directly
-15
u/[deleted] Feb 28 '26
No thanks. I’m good not letting AI destroy my pc