Copy link to clipboard
Copied
How to unzip file in InDesign ExtendScript? I tried to use jszip (a JavaScript lib) but I got some compile errors. I need to unzip a zip file and read all documents.
Try the following api
app.unpackageUCF("path to zip","destination folder")
Works for me for a simple zip created on a MAC, not sure if it would be able to do it for zip's created using some third party softwares using different compression algorithms.
-Manan
Copy link to clipboard
Copied
Try the following api
app.unpackageUCF("path to zip","destination folder")
Works for me for a simple zip created on a MAC, not sure if it would be able to do it for zip's created using some third party softwares using different compression algorithms.
-Manan
Copy link to clipboard
Copied
The parameters for unpackageUCF are a file object and a folder object, not strings.
P.
Copy link to clipboard
Copied
Hi Peter Kahrel,
I did test the code on CC2014 with strings and it did work fine, anyhow using a file and folder object would not harm
-Manan
Copy link to clipboard
Copied
Hi Peter!
I tested app.unpackageUCF.
If both the folder name and file name are English, it works perfectly.
However, if the one of file name is Korean, the name of the extracted file was broken.
What should we do in this case?
Copy link to clipboard
Copied
Go through the discussion in the following thread as well, it has some alternative approaches as well.
ZIP-package from indesign (by script)
-Manan
Copy link to clipboard
Copied
Thank you, it works, but as Peter said I needed to pass File and Folder as parameters.