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

ZIP-package from indesign (by script)

Guide ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

we have a javascript that writes lot´s of files from indesign... developers of the next step asked if it´s possible that indesign would package all those files to a ZIP-pacakge... is it possible?

TOPICS
Scripting

Views

13.6K

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

Guide , Jun 20, 2011 Jun 20, 2011

JsZip is not very fast when 'wrapped' in ExtendScript, but it works.

I think you only have to patch File / Folder access…

Just found this old piece of code in my drawers:

#include 'jszip/jszip.js'

JSZip.prototype.addExistingFile = function(/*File*/f, newName)
{
var contents = false;

if( f.constructor == File && f.exists && (f.encoding = 'BINARY') && f.open('r') )
     {
     contents = f.read();
     f.close();
     return this.add(newName||f.name, contents, {binary: true, date:f.modified});
     }
throw new

...

Votes

Translate

Translate
LEGEND ,
Mar 02, 2012 Mar 02, 2012

Copy link to clipboard

Copied

I'm sorry, Philippe, I'm still having a lot of difficulty understanding you.

Maybe you could try to find someone who is a native speaker of English?

Thanks, and sorry about that.

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
Enthusiast ,
Mar 03, 2012 Mar 03, 2012

Copy link to clipboard

Copied

Hello

Ditto with, is it possible to exclude *. DS_Store.

thank you

Bonjour

Avec ditto, est-il possible exclure les *.DS_Store.

Merci

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
LEGEND ,
Mar 03, 2012 Mar 03, 2012

Copy link to clipboard

Copied

Phillipe asks:

Ditto with, is it possible to exclude *. DS_Store.

No. With ditto, it is not possible to exclude files or directories.

You could copy the directory first with "cp" and remove the .DS_Store file.

You could delete the .DS_Store file for the zip archive using zip -d.

Or you could simply create the zip file using zip.

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
Enthusiast ,
Mar 04, 2012 Mar 04, 2012

Copy link to clipboard

Copied

Hello,

The ultimate goal set to open a IDML, modify and close without open Indesign.

Philippe

Bonjour,

Le but final set de pouvoir ouvrir un idml, le modifier et le refermer sans avoir Indesign ouvert.

Philippe

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 ,
Mar 04, 2012 Mar 04, 2012

Copy link to clipboard

Copied

Philippe Ruelle wrote:

The ultimate goal set to open a IDML, modify and close without open Indesign.

If this script still needs to run inside InDesign, that would be rather pointless

Oh let's have Google Translate a go at this as well: "Si ce script doit encore courir à l'intérieur d'InDesign, ce serait plutôt inutile " (Don't you trust your own English? At times I have to revert to your original in French to have it make sense!)

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
Enthusiast ,
Mar 04, 2012 Mar 04, 2012

Copy link to clipboard

Copied

I want to change or create database files (the sound of txt)
But also a docx file conversion to IDML or Adobe InDesign tagged text ...

I'll cross that I travailier faster in Perl.
thank you

Google translation.

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 ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

From the InDesign CS5 cookbook.

https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs5_docs/idml/idml-cookbook.pdf

Even though in the example in the cookbook are for .idml files, packageUCF and unpackageUCF works for regular zip files too. It worked for me try it out.

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
LEGEND ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

packageUCF and unpackageUCF does not work very well for image files.

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 ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

Thanks for the info Harbs. Didn't knew that. Do you have any insight on what happens when we use packageUCF or unpackageUCF. I mean is the image compression lossy or does it randomly throw error and is unreliable. Thanks again.

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
LEGEND ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

If I remember correctly, it simply does not work. I don't remember if the export fails or the files are missing.

IIRC, font files also cause problems.

In short, it only reliably zips files it expects in an IDML structure. It's not a full zip implementation.

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 ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

LATEST

Thanks a lot!

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