Div — a simple Alfred window manager
There are tons of window managers for Mac OS X around. Chris Coyier published a nice comparison of the most popular ones some time ago. These apps are great utilities that can boost your productivity by eliminating the time that you normally spend adjusting the window positions on your screen. I was using Divvy by Mizage for a long time and it worked like a charm for me. Another app that I use non-stop is Alfred. It looks like the default Spotlight search feature but it is much more powerful than that. It allows you to create advanced search functionality, custom hotkeys, explore files, control apps, store snippets, use clipboard history and so on. The app in itself is a subject that deserves a separate article (expect one soon).
Being uber minimalistic in terms of my workflow I decided to create a windows manager for Alfred. Say hello to Div! It is a simple Applescript (which incidentally was great fun to learn) with many triggers attached to it. I even created a logo for it :)

How to use Div
As I mentioned previously — Div is a simple script with many options to control it. You can download it from Packal — a community driven repository of the best Alfred workflows. It comes with some predefined layout settings, but it’s dead easy to add custom ones. It is written in AppleScript — a very basic scripting language to do practical but also cool stuff on Apple computers.
Enable access for assistive devices (required)
AppleScript works nicely with the majority of Mac OS X applications. Unfortunately some of them are non-scriptable. The solution is not to control app’s position but the window around it. We need to give Alfred access for assistive devices first. Just follow these easy steps:
- Open System Preferences
- Go to Security & Privacy
- Go to Privacy tab
- Go to the Accessibility on the left panel
- Click the lock and type your password
- Click small + icon and add Alfred from the list
- Done :)

Predefined list of layouts
Div comes with a predefined list of layouts. To use one simply type div
and choose an option from the list.

Using hotkeys
There are a few predefined settings. It is probably the quickest and most efficient way to manage your layouts. That’s how I use it mainly. Bind your favorite hotkeys to these settings or even add your own ones.
⌃ ⌥ 1
Full⌃ ⌥ 2
Medium⌃ ⌥ 3
Small⌃ ⌥ ←
Left⌃ ⌥ →
Right⌃ ⌥ ↑
Top⌃ ⌥ ↓
Bottom

Custom arguments
Sometimes predefined settings are not enough. Div knows how to deal with these situations. It allows you to pass custom arguments to create a custom position. It accepts two or four arguments.
Custom boundaries
Choose custom boundaries by passing 4 space-separated values. For example div 20 20 80 80
will place the top left corner of an app 20% from the top and 20% from the left edge of the screen, and the bottom right corner 80% from the top and 80% from the left edge of the screen.

Custom size
Choose a custom size by passing 2 (space separated) values. For example div 800 600
will resize your window to 800px wide and 600px high and place the window in the middle of the screen.

Thanks for using Div
Hopefully you will find it useful. If you need something more advanced have a look at the amazing Alfred 2 layout workflow by Bodo Junglas. As always, user feedback is welcome. Use the comments section below to share your love, opinions or report any bugs. If you would like to help me in the future development of Div feel free to fork it on Github and send a pull request. Enjoy!
Hi, I really like this workflow! It has become my most frequently used Alfred workflow. I hope it will support multiple screens in the future.
So happy to hear from happy user. I promise to drop support for multi screens very soon. Just need to find a spare moment and second screen to test with :) Thanks again @zeal7s:disqus for kind words!
Hi. Its been a while, but support for multiple monitors just landed :-)
Thank you so much for the multi monitor support!
Thanks for this!
Can you add to the road map: 1. Maximize, 2. Split screen, 3. move window to the next display (left/right)? with these additions I think most of us could remove the 3rd party apps we are using (I'm currently using MaxSnap because it's the only one I've seen that supports starting split screen)
Can you elaborate a little bit about each of your feature requests please?
Sure.
1. Maximize is different than expanding the window the full screen width, this is basically equivalent to pressing the green window button when the window isn't maximized.
2. Later versions of OSX have the ability to have 2 apps "maximized" next to each other, this is the equivalent to a long press on the green window button.
3. Many window managers have a way of moving the active window to the next display. So in a two monitor setup you can move the window to the next display, often you can choose if it moves it to the display to the left or the display to the right (only really useful if you have >2 displays)
Thanks for details and help.
1. In my opinion globally accessible shortcut (Cmd + Shift + F) is much quicker than messing around with Alfred to maximize a window.
2. I don't see a user friendly solution for this one within Alfred window interface. Even if this one is possible, it wouldn't be convenient to use.
3. This is a feature that I was planing to add one day and you may be assured that I will add it at some point.
Have a great day Michael :-)
Hey, this looks awesome. I dealt with the Accessibility settings. I'm still getting no response from selecting div commands from the Alfred command palette. Any ideas. I do use Path Finder instead of Finder, but I tried it with both active. Curious if you have this working on macOS Sierra
I'm sorry to see that something isn't working for you as expected. Can you describe your issue please? I'm more than happy to resolve a problem if it sit's on workflow's site. If its problem with your OS configuration I'll do my best to help you to run it.
I experienced the same issue on macOS Sierra. Basically installed Alfred, downloaded and imported Div, turned on accessibility settings and nothing happens. Even restarting the computer did not help.
Then I went into Alfred's preferences > workflows > div and started to poke around. Turns out, somehow the hotkey assignments are lost. I just reassigned "0 0 50 100" with is half size window on the left to "⌃ ⌥ ←", and now it started to work
Love it! Thanks for your great work!
Glad you found it useful! I'll update it very soon with few new features and support for multiple screens. Have a great day!
Any support for multiple screens yet? This is the only thing missing for me.
Hi :-)
I added support for multiple screens few months ago :) Works OK for me :)
So great workflow. I found Siema from you and that JS slider is great but this workflow is so great and blow my mind. So simple to use and customize and make my face smile !! Thank you.
Thank you for this wonderful tool ! :-)
I'm happy that you found it useful. Have a great day 🍩
Hi. Would love to use it. But it does not work for me either. Debugging in Alfred logs this "execution error: Finder got an error: Can’t get bounds of window of desktop. (-1728)". Settings in Accessibility done. Using latest version of Alfred and your workflow. Any ideas?
I encountered this error too, but it turns out it was because I had disabled my desktop with this command (to hide the clutter): defaults write com.apple.finder CreateDesktop -bool FALSE; killall Finder.
Thanks for this tip. It solved an issue for you and for many other users.
FYI - I used OnyX / parameters / 'hide desktop icons' to disable desktop icons, and the command you suggest doesn't work. But re-enabling desktop icons through OnyX fixed my problem
Awesome idea, and smart to implement it via Alfred. The extension works fine when entering div in Alfed, but I can't get the keyboard shortcuts to work. Alfred has access in the accessibility prefs. Any ideas why? Cheers!
For anyone looking for a solution, You have to set the controls yourself. Check this out: https://www.alfredforum.com...
Thanks for your help a lot 😻
Super helpful. Thank you @pawelgrzybek:disqus for building such a good tool. It now works perfectly well for my MacBook Pro 2018 running Catalina. Thanks @jvdmeji, I am glad that this is a quick fix.
Enjoy :-)
This is a great workflow! Thanks for sharing
Thanks a lot! I am glad that you found it useful.
Seriously...Is no one going to comment on all the 90s reference gifs?!? Granted the David Hasselhoff one did give me the jitters a lil bit. Haha
Anyway, great work on this workflow! I was just about to start using Raycast instead of Alfred if I hadn't found this neat trick. Keep up the good work!