• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unzip file in ExtendScript

Explorer ,
Jan 07, 2019 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.

TOPICS
Scripting

Views

3.7K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 07, 2019 Jan 07, 2019

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

Votes

Translate

Translate
Community Expert ,
Jan 07, 2019 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

Votes

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
community guidelines
Community Expert ,
Jan 07, 2019 Jan 07, 2019

Copy link to clipboard

Copied

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

P.

Votes

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
community guidelines
Community Expert ,
Jan 07, 2019 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

Votes

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
community guidelines
Community Beginner ,
Mar 11, 2020 Mar 11, 2020

Copy link to clipboard

Copied

LATEST

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?

Votes

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
community guidelines
Community Expert ,
Jan 07, 2019 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

Votes

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
community guidelines
Explorer ,
Jan 07, 2019 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.

Votes

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
community guidelines