7 Replies Latest reply on Jun 24, 2011 11:58 PM by John Hawkinson

    Indesign

    nandak1s

      Hi All,

      I need a complete package script,

      • Should copy images alone from existing opened Indesign doc
      • Create a new indesign document (any size)
      • Place images in same position as source in new doc
      • Package document
      • Cretae PDF (any PDF setting)

       

      is it possible for a indesign script to do all these items in one click.

       

      Please give brief if it is possible

        • 1. Re: Indesign
          sudar1983_14 Level 2

          Hello Nanda,

           

          Yes, possible. Read indesign scripting documents and try yourself.

           

          Regards,

          Arivu

          • 2. Re: Indesign
            nandak1s Level 1

            i will try  then mate... thanks

            • 3. Re: Indesign
              Muppet Mark Level 5

              Would it not make more sense to remove what you don't want in the doc and then 'save as'…?

              • 4. Re: Indesign
                nandak1s Level 1

                Yes it make sense, but a problem in package the document is a missing of plugin, whish is not allowing to package. "SScore.plugin"

                • 5. Re: Indesign
                  nandak1s Level 1

                  is there any possibility in indesign to select images alone and deleted other objects (eg - Text, designs, boxes...), if then please post it as script ,

                  i have a script to create package if any missing plugin found

                   

                   

                  var WR="WR-collect_ID v0.2\n\n";

                   

                  if (language == "de") {

                   

                  var MSG_ask = WR+"In welchen Unterordner des Dokuments m\xF6chtest du alle verkn\xFCpften Dateien sammeln?";
                  var MSG_correctlinks = WR+"Sollen die Dateipfade der Verkn\xFCpfungen angepasst werden?";
                  var MSG_statuslinked = "Gesammelte Verkn\xFCpfungen: ";
                  var MSG_errors = " (Fehler: ";
                  var MSG_statuscorrect = "\nDie Dateipfade der Verkn\xFCpfungen wurden angepasst.";
                  var MSG_statuscorrectno = "\nDie Dateipfade der Verkn\xFCpfungen wurden nicht angepasst.";
                  var MSG_notsaved = WR+"Dieses Dokument wurde noch nicht gespeichert, bitte holen Sie das nach.";
                  var MSG_nodocs = WR+"Kein Dokument ge\xF6ffnet."
                  var MSG_alreadycollected = WR+"Es wurden bereits alle Verkn\xFCpfungen gesammelt."

                   

                  } else {

                   

                  var linkedimagesfolder = "links";

                   

                  var MSG_ask = WR+"In which subfolder of your document do you want to collect the linked items?";
                  var MSG_correctlinks = WR+"Should the paths of the linked items be set to the subfolder?";
                  var MSG_statusplaced = "Collected links: ";
                  var MSG_errors = " (Errors: ";
                  var MSG_statuscorrect = "\nThe paths of the linked items where set to the subfolder.";
                  var MSG_statuscorrectno = "\nThe paths of the linked items where not altered.";
                  var MSG_notsaved = WR+"This document has never been saved, please save it.";
                  var MSG_nodocs = WR+"You have no open document."
                  var MSG_alreadycollected = WR+"All linked items have already been collected."

                   

                  }

                   

                  var error=0;

                   

                  try{app.activeDocument.fullName} catch(e) {error=1;}

                   

                  if (app.documents.length==0) {
                  alert(MSG_nodocs);
                  } else if ( error == 1) {
                  alert(MSG_notsaved);
                  }

                   

                  if (error == 0) {
                  var linkedimagesfolder = "Bilder";

                   

                  if (app.activeDocument.label != "") { linkedimagesfolder = app.activeDocument.label; }

                   

                  if (linkedimagesfolder=prompt(MSG_ask,linkedimagesfolder)) {
                  if (error < 1 && alreadycollected()>0 ) {
                  app.activeDocument.label = linkedimagesfolder;
                  collect();
                  }
                  }
                  }

                   

                  function alreadycollected() {
                  var theLinks = app.activeDocument.links;
                  var imagesfolder = app.activeDocument.filePath+"/"+linkedimagesfolder+"/";

                   

                  var newItems=0;

                   

                  for (var i = 0 ; i < theLinks.length; i++)
                  {
                  if(theLinks[i].filePath != File(imagesfolder+theLinks[i].name).fullName) {newItems++;}
                  }

                   

                  if (newItems==0) { alert(MSG_alreadycollected); }

                   

                  return newItems;
                  }

                   

                  function collect() {
                  var theLinks = app.activeDocument.links;

                   

                  var correctlinks = confirm(MSG_correctlinks);

                   

                  var imagesfolder = app.activeDocument.filePath+"/"+linkedimagesfolder+"/";

                   

                  var folder = new Folder(imagesfolder);

                   

                  var linkedImages=0;
                  var linkedErrors=0;

                   

                  folder.create();

                   

                  for (var i = 0 ; i < theLinks.length; i++)
                  {
                  source = theLinks[i];

                   

                  target = imagesfolder+theLinks[i].name;

                   

                  if (source.status == LinkStatus.linkMissing) {
                  linkedErrors++;
                  app.select(theLinks[i].parent);
                  }

                   

                  if (source.filePath != target && source.status != LinkStatus.linkMissing) {
                  linkedImages++;
                  if(theLinks[i].filePath != File(imagesfolder+theLinks[i].name).fullName) {
                  if (!File(source.filePath).copy(target)) {linkedErrors++;}
                  }

                   

                  if (correctlinks == true) {
                  theLinks[i].relink(File(target));
                  }
                  }
                  }

                   

                  var linksMSG="";
                  if (linkedErrors>0) {var linksMSG= MSG_errors+linkedErrors+")";}

                   

                  status=MSG_statuslinked+linkedImages+linksMSG;
                  if (correctlinks==true) {status=status+MSG_statuscorrect; } else {status=status+MSG_statuscorrectno; }

                   

                  alert(status);

                   

                  }

                   

                  Message was edited by: nandak1s

                  • 6. Re: Indesign
                    REVA83 Level 1

                    If you are currently working in CS4 means, just open the document in CS5 and convert into .idml.

                     

                    After that you can normally open the .idml document in your CS4 application without plugin missing problem. Then create package....

                    • 7. Re: Indesign
                      John Hawkinson Level 5

                      There's no need to mix and match CS4 and  CS5. Export to IDML and open the IDML all in whatever version you are using.