MicrostockGroup

Microstock Photography Forum - General => Software => Topic started by: lechyu on October 10, 2016, 11:38

Title: Faster Zip eps and jpg files
Post by: lechyu on October 10, 2016, 11: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?
Title: Re: Faster Zip eps and jpg files
Post by: Justanotherphotographer on October 11, 2016, 08:37
I needed this ages ago and never found a solution either. I'd be interested to know if anyone has one.
Title: Re: Faster Zip eps and jpg files
Post by: cthoman on October 11, 2016, 09:51
You can make an Apple Script:

Quote
set 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
Title: Re: Faster Zip eps and jpg files
Post by: Justanotherphotographer on October 21, 2016, 06:09
thanks for this, but I'm on a PC!
Title: Re: Faster Zip eps and jpg files
Post by: Morphart on October 24, 2016, 08:22
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.