Re: Unzip multiple items Applescript-terminal syntax help!
Re: Unzip multiple items Applescript-terminal syntax help!
- Subject: Re: Unzip multiple items Applescript-terminal syntax help!
- From: Cerciello <email@hidden>
- Date: Thu, 29 Oct 2009 13:56:45 +0100
Smashing Axel
do shell script ("cd " & this_path & "; find . -exec unzip -o {} \\;;
rm -rf __MACOSX") works beautifully. One thing not really important is
that if I see in the terminal what going on I see this:
Pippos-MacBook-Pro:~ gc$ cd '/Users/gc/Desktop/untitled folder/';
find . -exec unzip -o {} \;; rm -rf __MACOSX
unzip: cannot find or open ., ..zip or ..ZIP.
Archive: ./.DS_Store
End-of-central-directory signature not found. Either this file is
not a zipfile, or it constitutes one disk of a multi-part archive. In
the
latter case the central directory and zipfile comment will be found
on the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of ./.DS_Store or
./.DS_Store.zip, and cannot find ./.DS_Store.ZIP, period.
Archive: ./1.zip
inflating: UNIX Services Installer.pkg
creating: __MACOSX/
inflating: __MACOSX/._UNIX Services Installer.pkg
Archive: ./2.zip
etc...
Unfortunately the 2nd suggestion: do shell script ("cd " & this_path &
"; unzip -o *.zip; rm -rf __MACOSX") doesn't work, the terminal said:
Last login: Thu Oct 29 13:48:48 on ttys000
cd '/Users/gc/Desktop/untitled folder/'; unzip -o *.zip; rm -rf __MACOSX
Pippos-MacBook-Pro:~ gc$ cd '/Users/gc/Desktop/untitled folder/';
unzip -o *.zip; rm -rf __MACOSX
Archive: 1.zip
caution: filename not matched: 2.zip
caution: filename not matched: 3.zip
caution: filename not matched: 4.zip
caution: filename not matched: 5.zip
Pippos-MacBook-Pro:untitled folder gc$
Would also be possible to move to the trash the .zip files after been
unzipped?
That would be great.
Thank you
On Oct 29, 2009, at 1:09 PM, Axel Luttgens wrote:
Le 29 oct. 2009 à 12:46, Cerciello a écrit :
[...]
Any suggestion on how to combine this 2 lines in one "do shell
scrip" command?
Since the ";" expected by the find command is now correctly escaped,
just append your third shell command as usual:
do shell script ("cd " & this_path & "; find . -exec unzip -o {} \
\;; rm -rf __MACOSX")
The idea to create this service is for unzipping large files
downloaded from the net which often are splitted in hundreds of
small zip files. Usually I will run the service on a folder on my
desktop.
Are all those zip files a the top-level of the enclosing folder?
In which case you could perhaps consider an even simpler way, such as:
do shell script ("cd " & this_path & "; unzip -o *.zip; rm -rf
__MACOSX")
HTH,
Axel _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden