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: "Mark J. Reed" <email@hidden>
- Date: Fri, 30 Oct 2009 07:35:18 -0400
If the zip files are all in one folder, with no subfolders, then you
don't need find - you can just use a for loop, as someone suggested
upthread:
for f in *.zip; do unzip "$f" && mv "$f" ~/.Trash; done; mv _MACOSX ~/.Trash
conversely, if there are subfolders, the "mv *.zip" won't get them
all; you need to use find for that too, and worry about collisions in
the trash folder.
find . -name '*.zip' -exec unzip {} \; -exec mv -i {} ~/.Trash
On Thursday, October 29, 2009, Cerciello <email@hidden> wrote:
> Finally the complite working line I was looking for.
>
> Thanx allot to Axel and Mark and everyone else that posted suggestions. I also changed "rm" with "mv" in the last line just to be sure that I don't loose the source .zip files if somthing go wrong:
>
> do shell script "cd " & this_path & "&& find . -name '*.zip' -exec unzip -o {} \\;; mv __MACOSX *.zip /Users/gc/.Trash/"
>
> and back to the other question Axel, yes the integrity of the files and folders appear to be correct as they have icons and works fine. The only exeption are for the aliases which are not resolved. However symlinks are fine. Any idea why?
>
> Best regards
> gC
>
> On Oct 29, 2009, at 3:02 PM, Axel Luttgens wrote:
>
>
> Le 28 oct. 2009 à 22:47, Cerciello a écrit :
>
>
> [...]
> do script "cd " & this_path & find . -exec unzip -o {} \; & rm -rf __MACOSX;
> [...]
>
>
> Back to another question: are you sure to have retrieved all wanted data, even after having deleted the __MACOSX directory? That is, aren't the archives you are unzipping liable to contain files with a resource fork or other vital metadata?
>
> Axel
>
>
> _______________________________________________
> 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
>
>
> _______________________________________________
> 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
>
--
Mark J. Reed <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