Solving the macOS RAR Problem: From Terminal to Shortcuts
In the future year of 2025 we always envisioned technology as a seamless extension of our support system. Yet here I am, with a three thousand dollar computer that can’t open a .rar file. It’s December 2024, the .rar was invented in 1993, about 32 years ago. For 32 years, no thought to license and integrate the RAR format. It’s quite admirable really, a testament.
RAR is proprietary and other formats arent so its making a point by not using it. I shouldn’t have to dig through Homebrew documentation or fall down Reddit rabbit holes just to open a rar file though. I could install unrar through the terminal and call it a day, but I didn’t want to open terminal every single time I want to open a file. I should be able to click on it and it opens. I would like to experience the computer like a normal person. So I automated the whole thing.
- First in Automator.
- Secondly, I believe sharing is caring…
- Thirdly, and finally, converted the automation to Shortcuts.
Step One: Getting the Actual Tool
Before I could automate anything, I needed the extraction tool itself. Homebrew made this pretty straightforward:
brew install unrar
Once installed, I had to figure out exactly where it lived on the system. This is important with macOS automation because their tools for some reason don’t always know where your stuff is.
which unrar
Output: /usr/local/bin/unrar (or /opt/homebrew/bin/unrar)
First Try: Automator Quick Action
My first move was to build a macOS Quick Action. This would let me right-click a file in Finder and run a custom command from the menu. I threw together a Shell Script workflow with pretty straightforward logic: grab the selected file, find its directory, and run unrar.
The Script
for f in "$@"
do
cd "$(dirname "$f")"
/usr/local/bin/unrar x "$f"
done
The Annoying Part
Notice I couldn’t just write unrar x "$f" and be done with it.
When Automator (or Shortcuts) runs a shell script, it doesn’t load your user profile. No .zshrc, no .bash_profile, nothing. So it has zero clue where Homebrew puts things. I had to hardcode the full path: /usr/local/bin/unrar.
This worked, but it felt dated. Sharing Automator workflows is a pain. You have to physically send the .workflow file, the recipient has to install it in some specific library folder, there’s signing, there’s permissions. I wanted something cleaner.
Second Try: Moving to Shortcuts
I decided to rebuild everything in Shortcuts. Better UI, easier sharing (just an iCloud link), and it syncs across all my Macs automatically.
The core logic stayed the same, but the implementation felt way cleaner.
I created a new Shortcut, enabled it for Quick Actions in Finder, and used the Run Shell Script action with /bin/zsh as the shell.
The Setup
- Input: Receives Files from Quick Actions
- Action: Run Shell Script
- Shell: /bin/zsh
- Pass Input: as arguments
Same as before, I had to be explicit with the file path:
for f in "$@"
do
cd "$(dirname "$f")"
/usr/local/bin/unrar x "$f"
done
The End Result
Now when I download a RAR file, I don’t touch the terminal at all. Right-click, hit “Unrar Here,” and the folder just appears. I uploaded the shortcut to RoutineHub so I can manage updates and versions without any hassle.