3 Replies Latest reply on Feb 20, 2008 9:39 AM by Kasyan Servetsky

    How to save document preset.

      I am creating a document preset and i want to save that preset.

      Such as we can save the active document by saying,
      app.activeDocument.save(File("filename"), false);

      is there any such method which can save a created document preset.
      I tried to look in OMV but i could not find it.

      Thank you.
        • 1. Re: How to save document preset.
          Level 1
          In the OMV, choose Application under Classes. Scroll down to look at it's methods.

          exportPresets()

          Looks very likely to be what you want.

          Dave
          • 2. Re: How to save document preset.
            Level 1
            Thank you dave

            if (app.documentPresets.item ("Amit") == null)
            {
            with(app.documentPresets.add())
            {
            name = "Amit";
            pageHeight = "30p0";
            pageWidth = "40p0";
            left = "1p0";
            right = "1p0";
            top = "3p4";
            bottom = "3p1";
            columnCount = 2;
            pagesPerDocument = 4;
            pageOrientation = PageOrientation.portrait;
            }
            app.exportPresets(ExportPresetFormat , "Amit" , false);
            }

            I am using exportPresets() function i my script but i am getting error
            error number - 30477
            error string - Invalide value for parameter 'format' of event exportPresets enumerator but receiving nothing.

            I need to give some kind of number for exportPresets. I do not how it works,

            --Amit
            • 3. Re: How to save document preset.
              Kasyan Servetsky Level 5
              Hi Amit,
              //--------------------------------
              if (app.documentPresets.item ("Amit") == null)
              {
              with(app.documentPresets.add())
              {
              name = "Amit";
              pageHeight = "30p0";
              pageWidth = "40p0";
              left = "1p0";
              right = "1p0";
              top = "3p4";
              bottom = "3p1";
              columnCount = 2;
              pagesPerDocument = 4;
              pageOrientation = PageOrientation.portrait;
              }
              var myFile= new File("~/Desktop/Amit.dcst");
              app.exportPresets(ExportPresetFormat.DOCUMENT_PRESETS_FORMAT, myFile);
              }
              //--------------------------------
              Kasyan