Unraring and deleting ('unarchiving' rars)

(Thought I'd share this for anyone else looking to do the same thing)
I wrote to support with this:
Paul responded (promptly, I might add) with:
This turns out to be dead simple.
Download the mac version here: http://www.rarlab.com/download.htm
(the rar is trialware, but the unrar component seems to be free)
Install the unrar component (this step borrowed from here: http://www.robertvenema.nl/journal/arch ... -mac-os-x/):
Then in Hazel, add a shell script step:
then a 'Move to Trash' step
... and Bob's your uncle.
I wrote to support with this:
Trying to do this:
Open rar file and extract
Delete rar file
process extracted content
mimicking the automatic 'unarchive' process for zips. But by adding a 'move to trash' step after 'open with default program', some rars are moved to the trash before being extracted, and then fail since the file is in the trash.
I've been wondering for various actions how to create a delay, or an if > then set up (if rar has previously been extracted, then delete).
How would you solve this?
Paul responded (promptly, I might add) with:
You could try putting in a delay (like via a script) though the better solution is to track down one of the commandline programs that can unpack rars and trigger that via script. When done that way, Hazel will be able to wait until it is done before continuing.
This turns out to be dead simple.
Download the mac version here: http://www.rarlab.com/download.htm
(the rar is trialware, but the unrar component seems to be free)
Install the unrar component (this step borrowed from here: http://www.robertvenema.nl/journal/arch ... -mac-os-x/):
- Code: Select all
$ sudo install -c -o $USER unrar /bin
Then in Hazel, add a shell script step:
- Code: Select all
unrar x $1
then a 'Move to Trash' step
... and Bob's your uncle.