Applescript: terminal unrar command

Hey,


I would like to know if it's possible to make an applescript of the following terminal command(s).


cd


unrar e -r -o- *.rar && find ./ -name “*.r*” -delete


Also, I would like to know if it's possible to tweak the "unrar e -r -o- *.rar" command.


Following situation:


Main_folder\SubfolderA

Main_folder\SubfolderB

Main_folder\SubfolderC


when I login in to terminal and use the command => unrar e -r -o- *.rar


Everything from SubfolderA / SubfolderB & SubfolderC will be extracted in Main_folder


Now my question is: Is there a command that will extract the "*.rar" in the same subfolder as where they are stored.


Kind regards,


Maxime

MacBook Air, OS X Mountain Lion (10.8.2)

Posted on Jan 17, 2015 6:46 AM

Reply
6 replies

Jan 17, 2015 7:39 AM in response to xieeem

By now I found the following


on run {input, parameters}


tell application "Terminal"


activate


do script with command "cd /Volumes/******_storage/******* && unrar e -r -o- *.rar && find ./ -name “*.r*” -delete"


end tell


This works fine except that subfolders are still extracted in /******** instead of their own folder and that my files ain't deleted.

Jan 17, 2015 8:13 AM in response to Frank Caggiano

Hi Frank,


I try to unrar .rar files.


I've managed to tweak my automator script:


on run {input, parameters}


tell application "Terminal"


activate


do script with command "cd /Volumes/****_storage/Downloads && unrar e -r -o- *.rar && find /Volumes/****_storage/Downloads -name *.r* -type f -delete"


end eend tell


eenend run


The the subfolder remains an issue.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript: terminal unrar command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.