MicrostockGroup Sponsors

Faster Zip eps and jpg files

Started by lechyu, October 10, 2016, 17:38

Previous topic - Next topic

lechyu

Hi,
I have a case concerning compress files eps and jpg:
- I have a group of files eps and jpg. In this group there are a pair of the same name (vector1.eps and vector1.jpg; vector2.eps and vector2.jpg etc.)
- I would like to select all the files together and have it automatically compress to zip files, which will join my pairs and will have names vector1.zip, vector2.zip etc.

Is it possible in any program?

Justanotherphotographer

I needed this ages ago and never found a solution either. I'd be interested to know if anyone has one.

cthoman

You can make an Apple Script:

Quoteset startFolder to quoted form of POSIX path of ((path to desktop) & "zip folder" as string)
set jpegList to paragraphs of (do shell script "find " & startFolder & " -type f -iname '*.jpg'")

repeat with aFile in jpegList
   set fileName to name of (info for POSIX file aFile)
   set baseName to text 1 through -5 of fileName
   set epsName to quoted form of (baseName & ".eps")
   set jpegName to quoted form of (baseName & ".jpg")
   set zipName to quoted form of (baseName & ".zip")
   do shell script "cd " & startFolder & ";zip" & space & zipName & space & epsName & space & jpegName
end repeat

This is based off having a folder on your desktop called "zip folder". You put the files in there and run the script. Not sure if there are equivalent scripts for the PC.

Here's the original discussion on the Apple scripting forums:

https://discussions.apple.com/thread/2231269?start=15&tstart=0
Facebook     |     Twitter

Justanotherphotographer

thanks for this, but I'm on a PC!

Morphart

Quote from: lechyu on October 10, 2016, 17:38
Hi,
I have a case concerning compress files eps and jpg:
- I have a group of files eps and jpg. In this group there are a pair of the same name (vector1.eps and vector1.jpg; vector2.eps and vector2.jpg etc.)
- I would like to select all the files together and have it automatically compress to zip files, which will join my pairs and will have names vector1.zip, vector2.zip etc.

Is it possible in any program?

Contact me in Message, i have a script with 7za zip to do this.