Highlighted

Unzip file in ExtendScript

Explorer ,
Jan 07, 2019

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.

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

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

Topics

Scripting

Views

2.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Unzip file in ExtendScript

Explorer ,
Jan 07, 2019

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.

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

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

Topics

Scripting

Views

2.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Jan 07, 2019

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jan 07, 2019

Copy link to clipboard

Copied

The parameters for unpackageUCF are a file object and a folder object, not strings.

P.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jan 07, 2019

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Mar 11, 2020

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jan 07, 2019

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Jan 07, 2019

Copy link to clipboard

Copied

Thank you, it works, but as Peter said I needed to pass File and Folder as parameters.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...