CheckBoxControl

hi
how can i use a check box control to save to the database?
i habe 5 check boxes,the user can select either 1 or more and then i have to save to the corresponding table to the database,
pls help
monali

Thanks Sathish for your response.
I am doing exactly what you suggested.
My database has a table called evaluate_log which has two columns,error_id and error_type.The error_type represents each checkboxcontrol,
now i have another table called evaluate_errors,which contains the error_id.
now when the user chacks a particular checkbox,i want to pick up its corresponding error_id from evaluate_log and store it in evalaute_errors.
how can i do that?
please help,
Thanks
Monali

Similar Messages

  • Want to get placed images Dimension and Creation Date in Catalog

    Below is the script which is free with CS4. Is there anybody who can modify this script in a way which provide the creation date and dimension of the images in image catalog.
    //ImageCatalog.jsx
    //An InDesign C4 JavaScript
    @@@BUILDINFO@@@ "ImageCatalog.jsx" 2.0.0 5-December-2007
    //Creates an image catalog from the graphic files in a selected folder.
    //Each file can be labeled with the file name, and the labels are placed on
    //a separate layer and formatted using a paragraph style ("label") you can
    //modify to change the appearance of the labels.
    //For more information on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //Or visit the InDesign Scripting User to User forum at http://www.adobeforums.com .
    //The myExtensions array contains the extensions of the graphic file types you want
    //to include in the catalog. You can remove extensions from or add extensions to this list.
    //myExtensions is a global. Mac OS users should also look at the file types in the myFileFilter function.
    main();
    function main(){
    var myFilteredFiles;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    myExtensions = [".jpg", ".jpeg", ".eps", ".ps", ".pdf", ".tif", ".tiff", ".gif", ".psd", ".ai"]
    //Display the folder browser.
    var myFolder = Folder.selectDialog("Select the folder containing the images", "");
    //Get the path to the folder containing the files you want to place.
    if(myFolder != null){
       if(File.fs == "Macintosh"){
        myFilteredFiles = myMacOSFileFilter(myFolder);
       else{
        myFilteredFiles = myWinOSFileFilter(myFolder);
       if(myFilteredFiles.length != 0){
         myDisplayDialog(myFilteredFiles, myFolder);
         alert("Done!");
    //Windows version of the file filter.
    function myWinOSFileFilter(myFolder){
    var myFiles = new Array;
    var myFilteredFiles = new Array;
    for(myExtensionCounter = 0; myExtensionCounter < myExtensions.length; myExtensionCounter++){
      myExtension = myExtensions[myExtensionCounter];
            myFiles = myFolder.getFiles("*"+ myExtension);
      if(myFiles.length != 0){
       for(var myFileCounter = 0; myFileCounter < myFiles.length; myFileCounter++){
        myFilteredFiles.push(myFiles[myFileCounter]);
    return myFilteredFiles;
    function myMacOSFileFilter(myFolder){
    var myFilteredFiles = myFolder.getFiles(myFileFilter);
    return myFilteredFiles;
    //Mac OS version of file filter
    //Have to provide a separate version because not all Mac OS users use file extensions
    //and/or file extensions are sometimes hidden by the Finder.
    function myFileFilter(myFile){
    var myFileType = myFile.type;
    switch (myFileType){
      case "JPEG":
      case "EPSF":
      case "PICT":
      case "TIFF":
      case "8BPS":
      case "GIFf":
      case "PDF ":
       return true;
       break;
      default:
      for(var myCounter = 0; myCounter<myExtensions.length; myCounter++){
       var myExtension = myExtensions[myCounter]; 
       if(myFile.name.indexOf(myExtension)>-1){
        return true;
        break;  
    return false;
    function myDisplayDialog(myFiles, myFolder){
    var myLabelWidth = 112;
    var myStyleNames = myGetParagraphStyleNames(app);
    var myLayerNames = ["Layer 1", "Labels"];
    var myDialog = app.dialogs.add({name:"Image Catalog"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       staticTexts.add({staticLabel:"Information:"});
      with(borderPanels.add()){
       with(dialogColumns.add()){
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Source Folder:", minWidth:myLabelWidth});
         staticTexts.add({staticLabel:myFolder.path + "/" + myFolder.name});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Number of Images:", minWidth:myLabelWidth});
         staticTexts.add({staticLabel:myFiles.length + ""});
      with(dialogRows.add()){
        staticTexts.add({staticLabel:"Options:"});
      with(borderPanels.add()){
       with(dialogColumns.add()){
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Number of Rows:", minWidth:myLabelWidth});
         var myNumberOfRowsField = integerEditboxes.add({editValue:3});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Number of Columns:", minWidth:myLabelWidth});
         var myNumberOfColumnsField = integerEditboxes.add({editValue:3});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Horizontal Offset:", minWidth:myLabelWidth});
         var myHorizontalOffsetField = measurementEditboxes.add({editValue:12, editUnits:MeasurementUnits.points});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Vertical Offset:", minWidth:myLabelWidth});
         var myVerticalOffsetField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
        with (dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Fitting:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myFitProportionalCheckbox = checkboxControls.add({staticLabel:"Proportional", checkedState:true});
          var myFitCenterContentCheckbox = checkboxControls.add({staticLabel:"Center Content", checkedState:true});
          var myFitFrameToContentCheckbox = checkboxControls.add({staticLabel:"Frame to Content", checkedState:true});
        with(dialogRows.add()){
          var myRemoveEmptyFramesCheckbox = checkboxControls.add({staticLabel:"Remove Empty Frames:", checkedState:true});
      with(dialogRows.add()){
        staticTexts.add({staticLabel:""});
      var myLabelsGroup = enablingGroups.add({staticLabel:"Labels", checkedState:true});
      with (myLabelsGroup){
       with(dialogColumns.add()){
        //Label type
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Type:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
        //Text frame height
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Height:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelHeightField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
        //Text frame offset
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Offset:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelOffsetField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.points});
        //Style to apply
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Style:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
        //Layer
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Layer:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLayerDropdown = dropdowns.add({stringList:myLayerNames, selectedIndex:0});
            var myResult = myDialog.show();
            if(myResult == true){
       var myNumberOfRows = myNumberOfRowsField.editValue;
       var myNumberOfColumns = myNumberOfColumnsField.editValue;
       var myRemoveEmptyFrames = myRemoveEmptyFramesCheckbox.checkedState;
       var myFitProportional = myFitProportionalCheckbox.checkedState;
       var myFitCenterContent = myFitCenterContentCheckbox.checkedState;
       var myFitFrameToContent = myFitFrameToContentCheckbox.checkedState;
       var myHorizontalOffset = myHorizontalOffsetField.editValue;
       var myVerticalOffset = myVerticalOffsetField.editValue;
       var myMakeLabels = myLabelsGroup.checkedState;
       var myLabelType = myLabelTypeDropdown.selectedIndex;
       var myLabelHeight = myLabelHeightField.editValue;
       var myLabelOffset = myLabelOffsetField.editValue;
       var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
       var myLayerName = myLayerNames[myLayerDropdown.selectedIndex];
       myDialog.destroy();
       myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName);
      else{
       myDialog.destroy();
    function myGetParagraphStyleNames(myDocument){
    var myStyleNames = new Array;
    var myAddLabelStyle = true;
    for(var myCounter = 0; myCounter < myDocument.paragraphStyles.length; myCounter++){
      myStyleNames.push(myDocument.paragraphStyles.item(myCounter).name);
      if (myDocument.paragraphStyles.item(myCounter).name == "Labels"){
       myAddLabelStyle = false;
    if(myAddLabelStyle == true){
      myStyleNames.push("Labels");
    return myStyleNames;
    function myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName){
    var myPage, myFile, myCounter, myX1, myY1, myX2, myY2, myRectangle, myLabelStyle, myLabelLayer;
    var myParagraphStyle, myError;
    var myFramesPerPage = myNumberOfRows * myNumberOfColumns; 
    var myDocument = app.documents.add();
    myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    var myDocumentPreferences = myDocument.documentPreferences; 
    var myNumberOfFrames = myFiles.length;
    var myNumberOfPages = Math.round(myNumberOfFrames / myFramesPerPage);
    if ((myNumberOfPages * myFramesPerPage) < myNumberOfFrames){ 
      myNumberOfPages++;
    //If myMakeLabels is true, then add the label style and layer if they do not already exist.
    if(myMakeLabels == true){
      try{
       myLabelLayer = myDocument.layers.item(myLayerName);
       //if the layer does not exist, trying to get the layer name will cause an error.
       myLabelLayer.name;
      catch (myError){
       myLabelLayer = myDocument.layers.add({name:myLayerName});
      //If the paragraph style does not exist, create it.
      try{
       myParagraphStyle = myDocument.paragraphStyles.item(myLabelStyle);
       myParagraphStyle.name;
      catch(myError){
       myDocument.paragraphStyles.add({name:myLabelStyle});
    myDocumentPreferences.pagesPerDocument = myNumberOfPages; 
    myDocumentPreferences.facingPages = false; 
    var myPage = myDocument.pages.item(0); 
    var myMarginPreferences = myPage.marginPreferences;
    var myLeftMargin = myMarginPreferences.left; 
    var myTopMargin = myMarginPreferences.top; 
    var myRightMargin = myMarginPreferences.right; 
    var myBottomMargin = myMarginPreferences.bottom; 
    var myLiveWidth = (myDocumentPreferences.pageWidth - (myLeftMargin + myRightMargin)) + myHorizontalOffset
    var myLiveHeight = myDocumentPreferences.pageHeight - (myTopMargin + myBottomMargin)
    var myColumnWidth = myLiveWidth / myNumberOfColumns
    var myFrameWidth = myColumnWidth - myHorizontalOffset
    var myRowHeight = (myLiveHeight / myNumberOfRows)
    var myFrameHeight = myRowHeight - myVerticalOffset
    var myPages = myDocument.pages;
    // Construct the frames in reverse order. Don't laugh--this will 
    // save us time later (when we place the graphics). 
    for (myCounter = myDocument.pages.length-1; myCounter >= 0; myCounter--){ 
      myPage = myPages.item(myCounter);
      for (var myRowCounter = myNumberOfRows; myRowCounter >= 1; myRowCounter--){ 
       myY1 = myTopMargin + (myRowHeight * (myRowCounter-1));
       myY2 = myY1 + myFrameHeight;
       for (var myColumnCounter = myNumberOfColumns; myColumnCounter >= 1; myColumnCounter--){ 
        myX1 = myLeftMargin + (myColumnWidth * (myColumnCounter-1));
        myX2 = myX1 + myFrameWidth;
        myRectangle = myPage.rectangles.add(myDocument.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:myDocument.swatches.item("None")}); 
    // Because we constructed the frames in reverse order, rectangle 1 
    // is the first rectangle on page 1, so we can simply iterate through 
    // the rectangles, placing a file in each one in turn. myFiles = myFolder.Files; 
    for (myCounter = 0; myCounter < myNumberOfFrames; myCounter++){ 
      myFile = myFiles[myCounter]; 
      myRectangle = myDocument.rectangles.item(myCounter);
      myRectangle.place(File(myFile));
      myRectangle.label = myFile.fsName.toString();
      //Apply fitting options as specified.
      if(myFitProportional){
       myRectangle.fit(FitOptions.proportionally);
      if(myFitCenterContent){
       myRectangle.fit(FitOptions.centerContent);
      if(myFitFrameToContent){
       myRectangle.fit(FitOptions.frameToContent);
      //Add the label, if necessary.
      if(myMakeLabels == true){
       myAddLabel(myRectangle, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myLayerName);
    if (myRemoveEmptyFrames == 1){ 
      for (var myCounter = myDocument.rectangles.length-1; myCounter >= 0;myCounter--){ 
       if (myDocument.rectangles.item(myCounter).contentType == ContentType.unassigned){
        myDocument.rectangles.item(myCounter).remove();
       else{
        //As soon as you encounter a rectangle with content, exit the loop.
        break;
    //Function that adds the label.
    function myAddLabel(myFrame, myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myLayerName){
    var myDocument = app.documents.item(0);
    var myLabel;
    var myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
    var myLabelLayer = myDocument.layers.item(myLayerName);
    var myLink =myFrame.graphics.item(0).itemLink;
    //Label type defines the text that goes in the label.
    switch(myLabelType){
      //File name
      case 0:
       myLabel = myLink.name;
       break;
      //File path
      case 1:
       myLabel = myLink.filePath;
       break;
      //XMP description
      case 2:
       try{
        myLabel = myLink.linkXmp.description;
        if(myLabel.replace(/^\s*$/gi, "")==""){
         throw myError;
       catch(myError){
        myLabel = "No description available.";
       break;
      //XMP author
      case 3:
       try{
        myLabel = myLink.linkXmp.author
        if(myLabel.replace(/^\s*$/gi, "")==""){
         throw myError;
       catch(myError){
        myLabel = "No author available.";
       break;
    var myX1 = myFrame.geometricBounds[1];
    var myY1 = myFrame.geometricBounds[2] + myLabelOffset;
    var myX2 = myFrame.geometricBounds[3];
    var myY2 = myY1 + myLabelHeight;
    var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
    myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
    myTextFrame.parentStory.texts.item(0).appliedParagraphStyle = myLabelStyle;   

    "Scripting Forum Conduct
    While this forum is a great place to get scripting help, it's also very easy to misuse it. Before using this forum, please read this post!"

  • Page Exporter Utility (PEU) 5 Script

    I love this script, It really has potential to shave valuable time off of our production (exporting Hundreds of pages manually to single files is tedious and time consuming). The problem I'm having is I'm hesitant to us it because it dosn't show warnings when there is a missing link or font. There's also no warning when it overwrites a file. My question is dose anyone know how to unsuppress the warnings? I've looked over the script and don't see anything that is actively suppressing them.
    Thanks
    Dan
    // PageExporterUtility5.0.js
    // An InDesign CS JavaScript
    // 08 NOV 2007
    // Copyright (C) 2007  Scott Zanelli. Lonelytree Software. (www.lonelytreesw.com)
    // Coming to you from Quincy, MA, USA
    // This program is free software; you can redistribute it and/or
    // modify it under the terms of the GNU General Public License
    // as published by the Free Software Foundation; either version 2
    // of the License, or (at your option) any later version.
    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    // You should have received a copy of the GNU General Public License
    // along with this program; if not, write to the Free Software
    // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    var peuINFO = new Array();
    peuINFO["csVersion"] = parseInt(app.version);
    // Save the old interaction level
    if(peuINFO.csVersion == 3) { //CS1
        peuINFO["oldInteractionPref"] = app.userInteractionLevel;
        app.userInteractionLevel = UserInteractionLevels.interactWithAll;
    else { //CS2+
        peuINFO["oldInteractionPref"] = app.scriptPreferences.userInteractionLevel;
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    // See if a document is open. If not, exit
    if((peuINFO["numDocsToExport"] = app.documents.length) == 0){
        byeBye("Please open a document and try again.",true);
    // Global Variable Initializations
    var VERSION_NAME = "Page Exporter Utility 5.0"
    var pseudoSingleton = 0;
    var progCurrentPage = 0;// Used for progress bar
    var progTotalPages = 0; // Used for progress bar
    var commonBatchINFO = getNewTempENTRY(); // Used if "Set For All Batch Jobs" is selected
    commonBatchINFO["infoLoaded"] = false;
    peuInit(); // Initialize commonly needed info
    // Store information needed for batch processing (valid for single also)
    var printINFO = new Array();
    // Get all needed info by looping for each document being exported
    for(currentDoc = 0; currentDoc < peuINFO.numDocsToExport; currentDoc++) {
        // Get name of document and set it as the base name
        // minus the extention if it exists
        var tempENTRY = getNewTempENTRY(); // "Struct" for current document info
        tempENTRY.theDoc = app.documents[currentDoc]
        tempENTRY.singlePage = (tempENTRY.theDoc.documentPreferences.pagesPerDocument==1)?true:false;
        tempENTRY.getOut = true;
        var baseName = (tempENTRY.theDoc.name.split(".ind"))[0];
        // Display the dialog box and loop for correct info
        if((!commonBatchINFO.infoLoaded && peuINFO.batchSameForAll) || (!peuINFO.batchSameForAll) ){// get all info
            do{
                tempENTRY.getOut = true; // For handling input errors
                var mainDialog = createMainDialog(tempENTRY.theDoc.name, currentDoc+1, peuINFO.numDocsToExport);
                // Exit if cancel button chosen
                if(!mainDialog.show() ){
                    mainDialog.destroy();
                    byeBye("Exporting has canceled by user.",peuINFO.sayCancel);
                if(formatTypeRB.selectedButton == 4 - peuINFO.adjustForNoPS){
                    changePrefs();
                    tempENTRY.getOut = false;
                    continue;
                // Read info from dialog items and keep as defaults and place in tempENTRY
                peuINFO.defaultDir = outputDirs.selectedIndex;
                // The index of the selected directory is the same as the
                // index in the array of directories.
                tempENTRY.outDir = peuINFO.dirListArray[peuINFO.defaultDir];
                // Type of renaming to do
                tempENTRY.nameConvType = namingConvention.selectedButton
                // The base name to add page info to
                tempENTRY.baseName = removeColons(removeSpaces(newBaseName.editContents) );
                // The start [and end] page numbers
                var startEndPgs = startEndPgs.editContents;
                // Wether to do spreads or not
                peuINFO.doSpreadsON = (doSpreads.checkedState)?1:0;
                tempENTRY.doSpreadsON = peuINFO.doSpreadsON;
                // Wether to send entire file as one document
                peuINFO.doOneFile = (oneFile.checkedState)?1:0;
                tempENTRY.doOneFile = peuINFO.doOneFile;
                // Export format type
                tempENTRY.formatType = formatTypeRB.selectedButton + peuINFO.adjustForNoPS;
                // Set persistence during warnings
                peuINFO.editStartEndPgs = startEndPgs;
                baseName = tempENTRY.baseName;
                peuINFO.exportDefaultType = tempENTRY.formatType;
                // Determine if page replacement token exists when the page token option is used
                if(peuINFO.pageNamePlacement == 2){
                    var temp = tempENTRY.baseName.indexOf("<#>");
                    if(temp == -1){//Token isn't there
                        alert("There is no page item token (<#>) in the base name. Please add one or change the page naming placement preference.");
                        tempENlert.getOut = false;
                        pseudoSingleton--; // Allow prefs to be accessed again, but just once
                        continue;
                    else
                        pseudoSingleton++;
                else // Try to remove any <#>s as a precaution
                    tempENTRY.baseName = tempENTRY.baseName.replace(/<#>/g,"");   
                // Layer Versioning & Batch options
                if(currentDoc < 1){
                    peuINFO.layersON = (doLayers.checkedState)?1:0;
                    if(peuINFO.numDocsToExport > 1){
                        peuINFO.batchSameForAll = (commonBatch.checkedState)?1:0;
                        peuINFO.batchON = (doBatch.checkedState)?1:0;
                        if(!peuINFO.batchON)
                            peuINFO.numDocsToExport = 1;
                //Check if spreads chosen with 'Add ".L"' option as this isn't supported.
                if(peuINFO.doSpreadsON && tempENTRY.nameConvType == 1){
                    alert ("Spreads cannot be used with the 'Add \".L\"' option.\nThis combination is not supported. (1.1)");
                    tempENTRY.nameConvType = 0;
                    tempENTRY.getOut = false;
                    continue;
                else if(peuINFO.doSpreadsON && tempENTRY.nameConvType == 4){
                    alert ("Spreads cannot be used with the 'Numeric Override' option.\nThis combination is not supported. (1.2)");
                    tempENTRY.nameConvType = 0;
                    tempENTRY.getOut = false;
                    continue;
                // Check if "Send Entire File At Once" is selected with JPG or EPS
                if(peuINFO.doOneFile && tempENTRY.formatType > 1 ){
                    alert ("The 'Send Entire File At Once' option can only be used with PostScript or PDF formats. (1.3)");
                    tempENTRY.getOut = false;
                    continue;
                // Check if: batch printing and using the "Same for all jobs options" and a page range other than "All" was used
                if(peuINFO.doBatch && peuINFO.batchSameForAll && startEndPgs != "All"){
                    alert ("The 'Set For All Batch Jobs' option can only be used with a Page Range of 'All'. Page Range has been reset to 'All'. (1.4)");
                    startEndPgs = "All";
                // Create page info, skip if doing entire file as one
                var tempPageCount = 0;
                if(tempENTRY.doOneFile)
                    tempPageCount = 1;
                else{
                    // Get names of all the pages. Needed when pages are named using sectioning
                    tempENTRY = recordPgNames(tempENTRY);
                    // Check Page Validity and get Page counts of entered section(s)
                    var temp = checkPages(tempENTRY, startEndPgs);
                    tempENTRY = temp[0];
                    tempPageCount = temp[1];
                    temp = null; // Free it up
            } while(!tempENTRY.getOut);
            // Remove dialog from memory
            mainDialog.destroy();
            // Determine if tag will fit correctly
            tempENTRY.useTag = usePgInfoTag(tempENTRY.theDoc.viewPreferences.horizontalMeasurementUnits,tempENTRY.theDoc.documentPreferences.pageWidth);
                // Get the format info for this document
            switch(tempENTRY.formatType){
                case 0://PS
                tempENTRY.psINFO = getPSoptions(tempENTRY.theDoc.name.split(".ind")[0]);
                break;
                case 1://PDF
                tempENTRY.pdfPRESET = getPDFoptions(tempENTRY);
                break;
                case 2: // EPS Formatting
                tempENTRY.epsINFO = getEPSoptions(tempENTRY.theDoc.name.split(".ind")[0]);
                peuINFO.origSpread = app.epsExportPreferences.epsSpreads;// Used to reset to original state when done
                app.epsExportPreferences.epsSpreads = peuINFO.doSpreadsON;
                break;
                case 3: // JPEG Formatting
                tempENTRY.jpegINFO = getJPEGoptions(tempENTRY.theDoc.name.split(".ind")[0]);
                break;
            // If Specific Directory was chosen for the output directory, get it now
            if(peuINFO.defaultDir == 0){
                tempENTRY.outDir = getDirectory("Please select the output directory:",peuINFO.startingDirectory);
                if(tempENTRY.outDir != null)
                    tempENTRY.outDir += "/";
                else
                    byeBye("Exporting has been canceled by user.", peuINFO.sayCancel);
            // Set the common elements for all batch jobs if it was selected
            if(!commonBatchINFO.infoLoaded && peuINFO.batchSameForAll){
                commonBatchINFO.infoLoaded = true;
                commonBatchINFO.pageNamePlacement = tempENTRY.pageNamePlacement;
                commonBatchINFO.outDir = tempENTRY.outDir;
                commonBatchINFO.nameConvType = tempENTRY.nameConvType
                commonBatchINFO.doSpreadsON = tempENTRY.doSpreadsON;
                commonBatchINFO.doOneFile = tempENTRY.doOneFile;
                commonBatchINFO.formatType = tempENTRY.formatType;
                commonBatchINFO.psINFO = tempENTRY.psINFO;
                commonBatchINFO.pdfPRESET = tempENTRY.pdfPRESET
                commonBatchINFO.epsINFO = tempENTRY.epsINFO
                commonBatchINFO.jpegINFO = tempENTRY.jpegINFO;
        } // End each/first of batch
        else{ // Get the base name for other batch jobs
            do{
                tempENTRY.getOut = true;
                var nameDialog = app.dialogs.add({name:(VERSION_NAME + ": Base Name for \"" + tempENTRY.theDoc.name + "\"" + ((peuINFO.numDocsToExport==1)?"":" (" + (currentDoc+1) + " of " + peuINFO.numDocsToExport + " documents)") ), canCancel:true} );
                with (nameDialog){
                    with (dialogColumns.add() ){
                        with(dialogRows.add() ){
                        staticTexts.add({staticLabel:"Enter the Base Name for \"" + tempENTRY.theDoc.name + "\""} );
                        var newBaseName = textEditboxes.add({editContents:baseName, minWidth:135} );
                        with(dialogRows.add() )
                            staticTexts.add({staticLabel:"", minWidth:400} );
                if(!nameDialog.show() ){
                    nameDialog.destroy();
                    byeBye("User canceled export.",peuINFO.sayCancel);
                else{
                    tempENTRY.baseName = removeColons(removeSpaces(newBaseName.editContents) );
                    nameDialog.destroy();
                    // Determine if page replacement token exists when the page token option is used
                    if(peuINFO.pageNamePlacement == 2){
                        var temp = tempENTRY.baseName.indexOf("<#>");
                        if(temp == -1){//Token isn't there
                            alert("There is no page item token (<#>) in the base name. Please add one or click cancel in the next dialog box.");
                            tempENTRY.getOut = false;
                    else // Try to remove any <#>s as a precaution
                        tempENTRY.baseName = tempENTRY.baseName.replace(/<#>/g,"");   
            }while(!tempENTRY.getOut);
            // Get names of all the pages. Needed when pages are named using sectioning
            tempENTRY = recordPgNames(tempENTRY);
            // Set pgStart and pgEnd, forcing "All" pages to output
            tempENTRY = (checkPages(tempENTRY, "All"))[0];
            // The page count is all pages due to common batching
            tempPageCount = tempENTRY.theDoc.pages.length;
            // This info is common, get it from commonBatchINFO:
            tempENTRY.pageNamePlacement = commonBatchINFO.pageNamePlacement;
            tempENTRY.outDir = commonBatchINFO.outDir;
            tempENTRY.nameConvType = commonBatchINFO.nameConvType
            tempENTRY.doSpreadsON = commonBatchINFO.doSpreadsON;
            tempENTRY.doOneFile = commonBatchINFO.doOneFile;
            tempENTRY.formatType = commonBatchINFO.formatType;
            tempENTRY.psINFO = commonBatchINFO.psINFO;
            tempENTRY.pdfPRESET = commonBatchINFO.pdfPRESET
            tempENTRY.epsINFO = commonBatchINFO.epsINFO
            tempENTRY.jpegINFO = commonBatchINFO.jpegINFO;
        // Get any layering info
        if(peuINFO.layersON){
            tempENTRY.layerINFO = layerManager(tempENTRY.theDoc);
            if (tempENTRY.layerINFO == null) // Only one layer, turn it off for this doc
                tempENTRY.layersON = false;
            else
                tempENTRY.layersON = true;
        // Sum up pages for the grand total for use in progress bar
        var temp = 1;
        if(peuINFO.doProgressBar && tempENTRY.layersON){
            // Figure tally for progress bar to include versions
            for(i=0;i < tempENTRY.layerINFO.verControls.length; i++)
                if (tempENTRY.layerINFO.verControls[i] == 1)
                    temp++;
            if(!peuINFO.baseLaersAsVersion)
                temp--;
        progTotalPages += (tempPageCount*temp);
        // All info for this doc is finally gathered, add it to the main printINFO array
        printINFO.push(tempENTRY);
        // Only one chance to change prefs: trigger singleton
        pseudoSingleton++;
    }// end of main for loop
    savePrefs(); // Record any changes
    // Initiallize progress bar if available
    if(peuINFO.doProgressBar)
        app.createProgressBar("Exporting Pages...", 0, progTotalPages, true);
    // Export by looping through all open documents if using batch option, otherwise just the front document is exported
    for(currentDoc = 0; currentDoc < printINFO.length; currentDoc++){
        var currentINFO = printINFO[currentDoc];
        // Set message in progress bar if available
        if(peuINFO.doProgressBar){
                var progCancel = app.setProgress(currentINFO.theDoc.name);
                if(progCancel)
                    byeBye("User canceled export.",peuINFO.sayCancel);
        // Set format options here so it's done just once per document
        setExportOption(currentINFO);
        // "Do one file" or PS/PDF with one page:
        if (currentINFO.doOneFile || currentINFO.singlePage){
            // Remove page token if it was entered and this name positioning option is set
            currentINFO.baseName = currentINFO.baseName.replace(/<#>/g,"");
            if(currentINFO.layersON){
                var theLayers = currentINFO.theDoc.layers;
                var baseControls = currentINFO.layerINFO.baseControls;
                var versionControls = currentINFO.layerINFO.verControls;
                var lastVersion = -1;
                // Loop for versioning
                 for(v = 0; v < versionControls.length; v++){
                    if(!versionControls[v])
                        continue;
                    if(lastVersion != -1)// Turn the last layer back off
                        theLayers[lastVersion].visible = false;
                    lastVersion = v;
                    theLayers[v].visible = true;
                    currentINFO.outfileName = addPartToName(currentINFO.baseName, theLayers[v].name, peuINFO.layerBeforeON)
                    // Export this version
                    exportPage(currentINFO, PageRange.allPages);
                    // Advance progress bar if available
                    if(peuINFO.doProgressBar)
                        advanceBar();
                // If Base layer/s is/are to be output as a version, do it now
                if(peuINFO.baseLaersAsVersion){
                    lastVersion = -1;
                    // Turn off all versioning layers
                    for(v = 0; v < currentINFO.layerINFO.baseControls.length; v++){
                        if(currentINFO.layerINFO.baseControls[v])// its a base layer, keep track of last base version layer number
                            lastVersion = v;
                        else
                            theLayers[v].visible = false;
                    if (!lastVersion == -1){// Only export if there was a base version
                        currentINFO.outfileName = addPartToName(currentINFO.baseName, theLayers[lastVersion].name, peuINFO.layerBeforeON);
                        // Export the base layer(s)
                        exportPage(currentINFO, PageRange.allPages);
                        // Advance progress bar if available
                        if(peuINFO.doProgressBar)
                            advanceBar();
            else{ // No layer versioning, just export
                currentINFO.outfileName = currentINFO.baseName;
                // Export the base layer(s)
                exportPage(currentINFO, PageRange.allPages);
                // Advance progress bar if available
                if(peuINFO.doProgressBar)
                    advanceBar();
            if(!peuINFO.batchON)
                byeBye("Done exporting as a single file.",true);
        else{ // Do single pages/spreads
            if (!currentINFO.hasNonContig)
                // Pages are contiguous, can just export
                outputPages(currentINFO.pgStart, currentINFO.pgEnd, currentINFO);
            else{ // Export non-contiguous
                // Loop through array of page sections
                for (ii = 0; ii < currentINFO.nonContigPgs.length; ii++){
                    temp = currentINFO.nonContigPgs[ii];
                    // Here we handle the start/end pages for any non-contig that has "-"
                    if (temp.indexOf("-") != -1){
                        temp2 = temp.split("-");
                        outputPages(temp2[0],temp2[1], currentINFO);
                    else // The non-contiguous page is a single page
                        outputPages(temp, temp, currentINFO);
        // Set the spread settings back to what it was originally
        try{
            switch (currentINFO.formatType){
                case 0: // PostScript Formatting
                    theDoc.printPreferences.printSpreads = peuINFO.origSpread;
                    break;
                case 1: // PDF Formatting
                    currentINFO.pdfPRESET.exportReaderSpreads = peuINFO.origSpread;
                    break;
                case 2: // EPS Formatting
                    app.epsExportPreferences.epsSpreads = peuINFO.origSpread;
                    break;
                case 3: // JPEG Formatting
                    app.jpegExportPreferences.exportingSpread = peuINFO.origSpread;
                    break;
        catch(e){/*Just ignore it*/}
    byeBye("The requested pages are done being exported.",true); // Last line of script execution
    /*         Operational Functions           */
    * Handle exporting
    function outputPages(pgStart, pgEnd, currentINFO){
        var pgRange;
        var layerName = "";
        var numVersions;
        var currentPage;
        var lastVersion = -1;
        var numericallyLastPage;
        if (currentINFO.layersON){
            var theLayers = currentINFO.theDoc.layers;
            var baseControls = currentINFO.layerINFO.baseControls;
            var versionControls = currentINFO.layerINFO.verControls;
            numVersions = versionControls.length;
            // Compensate for base layers as a version
            if(peuINFO.baseLaersAsVersion)
                numVersions++;
        else
            numVersions = 1;
        for (v = 0; v < numVersions; v++){
            if(currentINFO.layersON){
                if(v == (numVersions - 1) && peuINFO.baseLaersAsVersion){
                    var currentLayer = -1;
                    // Base layer(s) are to be output as a version
                    // Turn off all versioning layers
                    for(slbm = 0; slbm < baseControls.length; slbm++){
                        if(baseControls[slbm])// its a base layer, use its name for page name
                            currentLayer = slbm;
                        else
                            theLayers[slbm].visible = false;
                    // Check if there was no base layer at all
                    if (currentLayer == -1)
                        layerName = "**NO_BASE**"
                    else
                        layerName = theLayers[currentLayer].name;
                else{
                    if(!versionControls[v])
                        continue;
                    if(lastVersion != -1)// Turn the last layer back off
                        theLayers[lastVersion].visible = false;
                    lastVersion = v;
                    theLayers[v].visible = true;
                    layerName = theLayers[v].name;
            if (currentINFO.nameConvType == 4){
                currentPage = pgStart;
                numericallyLastPage = pgEnd;
            else if (currentINFO.doSpreadsON){
                currentPage = pgStart - 1;
                numericallyLastPage = pgEnd;
            else {
                currentPage = getPageOffset(pgStart, currentINFO.pageNameArray , currentINFO.pageRangeArray);
                numericallyLastPage = getPageOffset(pgEnd, currentINFO.pageNameArray, currentINFO.pageRangeArray);
            if(layerName != "**NO_BASE**"){
                do{
                    currentINFO.outfileName = getPageName(currentPage, layerName, currentINFO);
                    if (currentINFO.doSpreadsON){
                        pgRange = currentINFO.pageRangeArray[getPageOffset(currentINFO.theDoc.spreads[currentPage].pages[0].name, currentINFO.pageNameArray, currentINFO.pageRangeArray)];
                    else if (currentINFO.nameConvType == 4)
                        pgRange = currentINFO.pageRangeArray[currentPage-1];
                    else
                        pgRange = currentINFO.pageRangeArray[currentPage];
                    // Do the actual export:
                    exportPage(currentINFO, pgRange);
                    // Update progress bar if available
                    if(peuINFO.doProgressBar)
                        advanceBar();
                    currentPage++;
                } while(currentPage <= numericallyLastPage);
    * Export the page
    function exportPage(currentINFO, pgRange){
        var outFile = currentINFO.outDir + currentINFO.outfileName;
        switch (currentINFO.formatType){
            case 0: // PostScript Formatting
                with(currentINFO.theDoc.printPreferences){
                    printFile = new File(outFile + ((currentINFO.psINFO.ext)?".ps":""));
                    pageRange = pgRange;
                // Needed to get around blank pages using separations
                try{
                    currentINFO.theDoc.print(false);
                catch(e){/*Just skip it*/}
                break;
            case 1: // PDF Formatting
                app.pdfExportPreferences.pageRange = pgRange;
                currentINFO.theDoc.exportFile(ExportFormat.pdfType, (new File(outFile + ".pdf")), false, currentINFO.pdfPRESET);
                break;
            case 2: // EPS Formatting
                app.epsExportPreferences.pageRange = pgRange;
                currentINFO.theDoc.exportFile(ExportFormat.epsType, (new File(outFile + ".eps")), false);
                break;
            case 3: // JPEG Formatting
                if(pgRange == PageRange.allPages){
                    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportAll;
                else{
                    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
                    app.jpegExportPreferences.pageString = pgRange;
                currentINFO.theDoc.exportFile(ExportFormat.jpg, (new File(outFile + ".jpg")), false);
                break;
    * Create a name for the page being exported
    function getPageName(currentPage, layerName, currentINFO){
        var pgRename = "";
        if (currentINFO.doSpreadsON)
            currentINFO["currentSpread"] = currentINFO.theDoc.spreads[currentPage].pages;
        switch (currentINFO.nameConvType){
            case 3: // Odd/Even pages/spreads = .LA.F/LA.B, LB.F/LB.B ...
                pgRename = makeLotName(currentPage+1, peuINFO.subType);
                break;
            case 2: // Odd/Even pages/spreads = .F/.B
                pgRename = ((currentPage+1)%2 == 0) ? "B" : "F";
                break;
            case 1: // Add ".L" to the page name
                pgRename = "L" + currentINFO.pageNameArray[currentPage];
                break;
            case 0: case 4:// As is or Numeric Override
                            // Optionally add "P" and any zeros if options chosen and is numerically named
                            // otherwise, just the "seperatorChar" is added to page name
                if (currentINFO.doSpreadsON){
                    // Loops through number of pages per spread
                    // and adds each page name to the final name (P08.P01)
                    for (j = 0; j < currentINFO.currentSpread.length; j++){
                        if(currentINFO.currentSpread[j].appliedSection.includeSectionPrefix)
                            var tempPage = currentINFO.pageRangeArray[getPageOffset(currentINFO.currentSpread[j].name, currentINFO.pageNameArray, currentINFO.pageRangeArray)];
                        else
                            var tempPage = currentINFO.pageNameArray[getPageOffset(currentINFO.currentSpread[j].name, currentINFO.pageNameArray, currentINFO.pageRangeArray)];
                        var tempPageNum = parseInt(tempPage,10);
                        /* If section name starts with a number, need to compare length of orig vs parsed
                         * to see if the page name is solely a number or a combo num + letter, etc.
                        if (! isNaN(tempPageNum) && ((""+tempPage).length == (""+tempPageNum).length )){
                            if (peuINFO.addZeroON)
                                tempPage = addLeadingZero(tempPageNum, currentINFO.theDoc.pages.length);
                            if (peuINFO.addPon)
                                tempPage = "P" + tempPage;
                        pgRename = (j==0) ? tempPage : pgRename + peuINFO.charList[peuINFO.seperatorChar] + tempPage;
                else {
                    // Create a new name for an individual page
                    if (currentINFO.nameConvType == 4)
                        pgRename = currentPage;
                    else
                        pgRename = currentINFO.pageNameArray[currentPage];
                    if (! isNaN(parseInt(pgRename,10)) && (""+pgRename).length == (""+parseInt(pgRename,10)).length) {
                        if (peuINFO.addZeroON)
                            pgRename = addLeadingZero(pgRename, currentINFO.theDoc.pages.length);
                        if (peuINFO.addPon)
                            pgRename = "P" + pgRename;
                break;
        if(currentINFO.layersON)
            pgRename = addPartToName(pgRename, layerName, peuINFO.layerBeforeON);
        // Add page name to base name based on option selected
        if(peuINFO.pageNamePlacement == 2)
            pgRename = removeColons(currentINFO.baseName.replace(/<#>/g,pgRename) );
        else
            pgRename = addPartToName(currentINFO.baseName, pgRename,peuINFO.pageNamePlacement);
        return pgRename;
    * Add a name part before or after a given base string
    function addPartToName(theBase, addThis, addBefore){
        //Remove any colons
        theBase = removeColons(theBase);
        addThis = removeColons(addThis);
        return (addBefore) ? (addThis + peuINFO.charList[peuINFO.seperatorChar] + theBase ):(theBase + peuINFO.charList[peuINFO.seperatorChar] + addThis);
    * Find the offset page number for a page by its name
    function getPageOffset(pgToFind, pageNameArray, pageRangeArray){
        var offset;
        for(offset = 0; offset<pageRangeArray.length;offset++){
            if((""+ pgToFind).toLowerCase() == (("" + pageNameArray[offset]).toLowerCase() ) || (""+ pgToFind).toLowerCase() == (("" + pageRangeArray[offset]).toLowerCase() ) )
                return offset;
        return -1;
    * Replace any colons with specialReplaceChar
    function removeColons(tempName){
        return tempName.replace(/:/g,peuINFO.charList[peuINFO.specialReplaceChar]);
    * Remove spaces from front and end of name
    function removeSpaces(theName){
        // Trim any leading or trailing spaces in base name
        var i,j;
        for(i = theName.length-1;i>0 && theName.charAt(i) == " ";i--);// Ignore any spaces on end of name
        for(j = 0; j<theName.length && theName.charAt(j) == " ";j++);// Ignore any spaces at front of name
        theName = theName.substring(j,i+1);
        return theName
    * Add leading zero(s)
    function addLeadingZero(tempPageNum, pageCount){
        if(peuINFO.zeroPadding == 0){
            // Normal padding
            if((tempPageNum < 10 && pageCount < 100) || (tempPageNum > 9 && pageCount > 99 && tempPageNum < 100))
                return addSingleZero(tempPageNum);
            else if(tempPageNum < 10 && pageCount > 99)
                return addDoubleZero(tempPageNum);
            else
                return ("" + tempPageNum);
        }else if(peuINFO.zeroPadding == 1){
            // Pad to 2 digits
            if(tempPageNum < 10)
                return addSingleZero(tempPageNum);
            else
                return ("" + tempPageNum);
        }else{
            // Pad to 3 digits
            if(tempPageNum < 10)
                return addDoubleZero(tempPageNum);
            else if(tempPageNum < 100)
                return addSingleZero(tempPageNum);
            else
                return ("" + tempPageNum);
    * Add leading zero helper for single
    function addSingleZero(pgNum){
        return ("0" + pgNum);
    * Add leading zero helper for double
    function addDoubleZero(pgNum){
        return ("00" + pgNum);
    * Create lot name from page number
    function makeLotName(thePage, subType){
        var iii = thePage;
        var curr = 0;
        var alphaBet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        var lotName = "L";
        if(subType == 0){
            while(iii>52){
                curr = Math.floor((iii-1)/52)-1;
                lotName += alphaBet[curr];
                if(curr >= 0)
                    iii -= 52*(1+curr);
                else
                    iii -= 52;
            lotName += alphaBet[Math.floor((iii-1)/2)%26];
        else
            for(iii=thePage; iii>0; iii-=52)
                lotName += alphaBet[Math.floor((iii-1)/2)%26];
        return lotName += (thePage & 0x1)?".F":".B";
    * Advance progress bar one unit
    function advanceBar(){
        var progCancel = app.setProgress(++progCurrentPage);
        if(progCancel)
            byeBye("User canceled export.",peuINFO.sayCancel);
    * Create an Empty tempENTRY "struct"
    function getNewTempENTRY(){
        var newTempENTRY = new Array();
        newTempENTRY["theDoc"] = null;
        newTempENTRY["singlePage"] = null;
        newTempENTRY["getOut"] = null;
        newTempENTRY["outDir"] = null;
        newTempENTRY["outfileName"] = "";
        newTempENTRY["nameConvType"] = null;
        newTempENTRY["baseName"] = null;
        newTempENTRY["doSpreadsON"] = null;
        newTempENTRY["doOneFile"] = null;
        newTempENTRY["formatType"] = null;
        newTempENTRY["layersON"] = null;
        newTempENTRY["hasNonContig"] = false;
        newTempENTRY["nonContigPgs"] = null;
        newTempENTRY["pageNameArray"] = new Array();
        newTempENTRY["pageRangeArray"] = new Array();
        newTempENTRY["psINFO"] = null;
        newTempENTRY["pdfPRESET"] = null;
        newTempENTRY["epsINFO"] = null;
        newTempENTRY["jpegINFO"] = null;
        newTempENTRY["layerINFO"] = null;
        newTempENTRY["useTag"] = null;
        newTempENTRY["pgStart"] = null;
        newTempENTRY["pgEnd"] = null;
        return newTempENTRY;
    * Record all the page/spread names
    function recordPgNames(tempENTRY){
            // Get names of all the pages. Needed when pages are named using sectioning
        for (i = 0; i < tempENTRY.theDoc.documentPreferences.pagesPerDocument; i++){
            var aPage = tempENTRY.theDoc.pages.item(i);
            tempENTRY.pageNameArray[i] = aPage.name;
            tempENTRY.pageRangeArray[i] = (aPage.appliedSection.includeSectionPrefix)? aPage.name : (aPage.appliedSection.name + aPage.name);
        return tempENTRY;
    * Set the export options
    function setExportOption(currentINFO){
            // Set any options here instead of with each page
        switch (currentINFO.formatType){
            case 0: // PostScript Formatting
                setPSoptions(currentINFO);
                break;
            case 1: // PDF Formatting
                // Nothing to do
                break;
            case 2: // EPS Formatting
                setEPSoptions(currentINFO.epsINFO);
                break;
            case 3: // JPEG Formatting
                setJPEGoptions(currentINFO.jpegINFO);
                break;
    * Get PostScript format options
    function getPSoptions(docName){
        var psOptions = new Array();
        psOptions["ignore"] = true;
        var tempGetOut, PSdlog, pgHeight, pgWidth;
        var changeAddPSextention, tempBaseName;
        var printPreset;
        do{
            tempGetOut = true;
            PSdlog = app.dialogs.add({name:"PostScript Options for \"" + docName + "\"", canCancel:true} );
            with (PSdlog)
                with (dialogColumns.add() ){
                    with (dialogRows.add() )
                        staticTexts.add({staticLabel:"Print Presets:"} );
                    printPreset = dropdowns.add({stringList:peuINFO.psPrinterNames , minWidth:236, selectedIndex:peuINFO.defaultPrintPreset} );
                    with (dialogRows.add() )
                        staticTexts.add({staticLabel:"Override PS Page Size (" + peuINFO.measureLableArray[peuINFO.measurementUnits] + ")"} );
                    with (borderPanels.add() )
                        with (dialogColumns.add() )
                            with (dialogRows.add() ){
                                staticTexts.add({staticLabel:"Width:", minWidth:45} );
                                pgWidth = textEditboxes.add({editContents:"0", minWidth:53} );
                                staticTexts.add({staticLabel:"Height:", minWidth:45} );
                                pgHeight = textEditboxes.add({editContents:"0", minWidth:54} );
                    with (dialogRows.add() ){
                        staticTexts.add({staticLabel:"Add \".ps\" to end of file name"} );
                        changeAddPSextention = dropdowns.add({stringList:["No","Yes"], selectedIndex:peuINFO.addPSextention} )
            if((PSdlog.show()) ){
                // Get the page height + width
                pgHeight = parseFloat(pgHeight.editContents);
                pgWidth = parseFloat(pgWidth.editContents);
                // Check entered H & W for error
                if(isNaN(pgHeight) || isNaN(pgWidth) || pgHeight < 0 || pgWidth < 0 ){
                    alert ("Both page height and width must be numeric and greater than zero (3.1).");
                    pgHeight = "0";
                    pgWidth  = "0";
                    tempGetOut = false;
                    continue;
                if(pgHeight > 0 && pgWidth > 0) // User changed size, use the new size
                    psOptions.ignore = false;
                psOptions["height"] = pgHeight + peuINFO.measureUnitArray[peuINFO.measurementUnits];
                psOptions["width"] = pgWidth + peuINFO.measureUnitArray[peuINFO.measurementUnits];
                psOptions["ext"] = changeAddPSextention.selectedIndex;
                peuINFO.addPSextention = psOptions["ext"];
                psOptions["preset"] = printPreset.selectedIndex
                peuINFO.defaultPrintPreset = psOptions.preset;
                savePrefs();
                PSdlog.destroy();
            else{
                PSdlog.destroy();
                byeBye("Exporting has been canceled by user.",peuINFO.sayCancel);
        } while(!tempGetOut);
        return psOptions;
    * Set Postscript options
    function setPSoptions(theINFO){
        with(currentINFO.theDoc.printPreferences){
            activePrinterPreset = peuINFO.csPSprinters[theINFO.psINFO.preset];
            peuINFO.origSpread = printSpreads; // Used to reset to original state when done
            printSpreads = theINFO.doSpreadsON;
            if(colorOutput != ColorOutputModes.separations && colorOutput != ColorOutputModes.inripSeparations)
                printBlankPages = true;
            if (theINFO.useTag)
                pageInformationMarks = true;
            else
                pageInformationMarks = false;
            if(!theINFO.psINFO.ignore){
                try{
                    paperSize = PaperSizes.custom;
                    paperHeight = theINFO.psINFO.height;
                    paperWidth = theINFO.psINFO.width;
                catch(Exception){
                    alert ("The current PPD doesn't support custom page sizes. The page size from the Print Preset will be used (3.2).");
    * Get PDF options
    function getPDFoptions(theINFO){
        var PDFdlog = app.dialogs.add({name:"PDF Options for \"" + theINFO.theDoc.name.split(".ind")[0] + "\"", canCancel:true} );
        var temp = new Array();
        for(i=0;i<app.pdfExportPresets.length;i++)
            temp.push(app.pdfExportPresets[i].name);
        // Test if default PDFpreset is greater # than actual list.
        // This occurs if one was deleted and the last preset in the list was the default
        if(peuINFO.defaultPDFpreset > temp.length-1)
            peuINFO.defaultPDFpreset = 0;
        with (PDFdlog)
            with (dialogColumns.add() ){
                with (dialogRows.add() )
                    staticTexts.add({staticLabel:"PDF Export Preset:"} );
                pdfPresets = dropdowns.add({stringList: temp, minWidth:50, selectedIndex:peuINFO.defaultPDFpreset} );
        if(PDFdlog.show() ){
            temp = app.pdfExportPresets[pdfPresets.selectedIndex];
            peuINFO.defaultPDFpreset = pdfPresets.selectedIndex;
            peuINFO.origSpread = temp.exportReaderSpreads;
            try{
                temp.exportReaderSpreads = theINFO.doSpreadsON;
                temp.pageInformationMarks = (theINFO.useTag && temp.cropMarks)?true:false;
            }catch(e){/*ignore it*/}
            PDFdlog.destroy();
            return temp;
        else{
            PDFdlog.destroy();
            byeBye("PDF exporting has been canceled by user.", peuINFO.sayCancel);
    * Get JPEG options
    function getJPEGoptions(docName){
        var temp = new Array();
        var JPEGdlog = app.dialogs.add({name:"JPEG Options for \"" + docName + "\"", canCancel:true} );
        with (JPEGdlog)
            with (dialogColumns.add() ){
                with (dialogRows.add() )
                    staticTexts.add({staticLabel:"Quality:"} );
                JPEGquality = dropdowns.add({stringList:(new Array("Low","Medium","High","Maximum")) , minWidth:50, selectedIndex:peuINFO.defaultJPEGquality} );
                with (dialogRows.add() )
                    staticTexts.add({staticLabel:"Encoding Type:"} );
                    JPEGrender = dropdowns.add({stringList:["Baseline","Progressive"] , minWidth:50, selectedIndex:peuINFO.defaultJPEGrender } );
        if(JPEGdlog.show() ){
            peuINFO.defaultJPEGquality = JPEGquality.selectedIndex;
            temp["qualityType"] = peuINFO.defaultJPEGquality;
            peuINFO.defaultJPEGrender = JPEGrender.selectedIndex;
            temp["renderType"] = peuINFO.defaultJPEGrender;
        else{
            JPEGdlog.destroy();
            byeBye("JPEG exporting has been canceled by user.",peuINFO.sayCancel);
        JPEGdlog.destroy();
        return temp;
    * Set JPEG options
    function setJPEGoptions(theINFO){
        with(app.jpegExportPreferences){
            peuINFO.origSpread = exportingSpread; // Used to reset to original state when done
            exportingSpread = currentINFO.doSpreadsON;
            exportingSelection = false; // Export the entire page
            if(peuINFO.csVersion > 3)
                jpegExportRange = ExportRangeOrAllPages.exportRange;
            switch (theINFO.qualityType){
                case 0:
                    jpegQuality = JPEGOptionsQuality.low;
                    break;
                case 1:
                    jpegQuality = JPEGOptionsQuality.medium;
                    break;
                case 2:
                    jpegQuality = JPEGOptionsQuality.high;
                    break;
                case 3:
                    jpegQuality = JPEGOptionsQuality.maximum;
                    break;
            jpegRenderingStyle = (theINFO.renderType)? JPEGOptionsFormat.baselineEncoding : JPEGOptionsFormat.progressiveEncoding;
    * Get EPS options
    function getEPSoptions(docName){
        var epsOptions = new Array();
        var epsDialog = app.dialogs.add({name:"EPS Options for \"" + docName + "\"", canCancel:true} );
        var oldBleed = peuINFO.bleed;
        with (epsDialog){
            // Left Column
            with (dialogColumns.add() ){
                with (dialogRows.add() )
                with (borderPanels.add() )
                    with (dialogColumns.add() ){
                        with (dialogRows.add() )
                            staticTexts.add({staticLabel:"Flattener Presets:"} );
                        changeFlattenerPreset = dropdowns.add({stringList:peuINFO.flattenerNames , minWidth:180, selectedIndex:peuINFO.defaultFlattenerPreset} );
                        with (dialogRows.add() )
                            changeIgnoreOverride = checkboxControls.add({staticLabel:"Ignore Overrides", checkedState:peuINFO.ignoreON} );
                        with (dialogRows.add() )
                            staticTexts.add({staticLabel:"Preview Type:"} );
                        changePreviewPreset = dropdowns.add({stringList:peuINFO.previewTypes , minWidth:180, selectedIndex:peuINFO.defaultPreview} );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Bleed:"} );
                            changeBleedVal = realEditboxes.add({editValue:peuINFO.bleed, minWidth:60} );
                            staticTexts.add({staticLabel:peuINFO.measureLableArray[peuINFO.measurementUnits]} );
                        with (dialogRows.add() )
                            staticTexts.add({staticLabel:"OPI Options:"} );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Omit:"} );
                            changeOpiEPS = checkboxControls.add({staticLabel:"EPS", checkedState:peuINFO.epsON} );
                            changeOpiPDF = checkboxControls.add({staticLabel:"PDF", checkedState:peuINFO.pdfON} );
                            changeOpiBitmap = checkboxControls.add({staticLabel:"Bitmapped", checkedState:peuINFO.bitmapON} );
            // Right column
            with (dialogColumns.add() ){
                with(borderPanels.add() ){
                    with(dialogColumns.add() ){
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"PostScript level:"} );
                            var changePSlevel = dropdowns.add({stringList:["2","3"] , minWidth:75, selectedIndex:peuINFO.psLevel} );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Color mode:"} );
                            if(peuINFO.csVersion == 3)
                                var changeColorMode = dropdowns.add({stringList:["Unchanged","Grayscale", "RGB", "CMYK"] , minWidth:100, selectedIndex:peuINFO.colorType } );
                            else
                                var changeColorMode = dropdowns.add({stringList:["Unchanged","Grayscale", "RGB", "CMYK","PostScript Color Management"] , minWidth:100, selectedIndex:peuINFO.colorType } );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Font embedding:"} );
                            var changeFontEmbedding = dropdowns.add({stringList:["None","Complete", "Subset"] , minWidth:100, selectedIndex:peuINFO.fontEmbed } );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Type of data to send:"} );
                            var changeDataToSend = dropdowns.add({stringList:["All","Proxy"] , minWidth:50, selectedIndex:peuINFO.dataSent } );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Data type:"} );
                            var changeDataType = dropdowns.add({stringList:["Binary","ASCII"] , minWidth:50, selectedIndex:peuINFO.dataType } );
                        with (dialogRows.add() ){
                            staticTexts.add({staticLabel:"Perform OPI replacement:"} );
                            var changeOPIreplace = dropdowns.add({stringList:["No","Yes"] , minWidth:50, selectedIndex:peuINFO.opiReplacement} );
        do{
            var getOut = true;
            if((epsDialog.show()) ){
                // Use these to update the prefs file
                peuINFO.defaultFlattenerPreset = changeFlattenerPreset.selectedIndex;
                peuINFO.ignoreON = (changeIgnoreOverride.checkedState)?1:0;
                peuINFO.defaultPreview = changePreviewPreset.selectedIndex;
                peuINFO.bleed = changeBleedVal.editContents;
                peuINFO.epsON = (changeOpiEPS.checkedState)?1:0;
                peuINFO.pdfON = (changeOpiPDF.checkedState)?1:0;
                peuINFO.bitmapON = (changeOpiBitmap.checkedState)?1:0;
                peuINFO.psLevel = changePSlevel.selectedIndex;
                peuINFO.colorType = changeColorMode.selectedIndex;
                peuINFO.fontEmbed = changeFontEmbedding.selectedIndex;
                peuINFO.dataSent = changeDataToSend.selectedIndex;
                peuINFO.dataType = changeDataType.selectedIndex;
                peuINFO.opiReplacement = changeOPIreplace.selectedIndex;
                // Check if bleed value is OK
                peuINFO.bleed = parseFloat(peuINFO.bleed)
                if (isNaN(peuINFO.bleed)){
                    alert("Bleed value must be a number (1.1).");
                    getOut = false;
                    peuINFO.bleed = oldBleed;
                else if (peuINFO.bleed < 0){
                    alert("Bleed value must be greater or equal to zero (1.2).");
                    getOut = false;
                    peuINFO.bleed = oldBleed;
                else {
                    // Check if bleed is too big
                    try {
                        app.epsExportPreferences.bleedBottom = "" + peuINFO.bleed + peuINFO.measureUnitArray[peuINFO.measurementUnits];
                    catch (Exception){
                        alert("The bleed value must be less than one of the following: 6 in | 152.4 mm | 432 pt | 33c9.384");
                        getOut = false;
                        peuINFO.bleed = oldBleed;
            else{
                epsDialog.destroy();
                byeBye("EPS Export canceled by user.", peuINFO.sayCancel);
        }while(!getOut);
            // These are used for exporting
            epsOptions["defaultFlattenerPreset"] = changeFlattenerPreset.selectedIndex;
            epsOptions["ignoreON"] = peuINFO.ignoreON;
            epsOptions["defaultPreview"] = changePreviewPreset.selectedIndex;
            epsOptions["bleed"] = peuINFO.bleed;
            epsOptions["epsON"] = peuINFO.epsON;
            epsOptions["pdfON"] = peuINFO.pdfON;
            epsOptions["bitmapON"] = peuINFO.bitmapON;
            epsOptions["psLevel"] = changePSlevel.selectedIndex;
            epsOptions["colorType"] = changeColorMode.selectedIndex;
            epsOptions["fontEmbed"] = changeFontEmbedding.selectedIndex;
            epsOptions["dataSent"] = changeDataToSend.selectedIndex;
            epsOptions["dataType"] = changeDataType.selectedIndex;
            epsOptions["opiReplacement"] = changeOPIreplace.selectedIndex;
            epsDialog.destroy();
            return epsOptions;
    *     Apply chosen settings to the EPS export prefs
    function setEPSoptions(theINFO){
        with(app.epsExportPreferences){
            appliedFlattererPreset = peuINFO.flattenerNames[theINFO.defaultFlattenerPreset];
            bleedBottom = "" + theINFO.bleed + peuINFO.measureUnitArray[peuINFO.measurementUnits];
            bleedInside = bleedBottom;
            bleedOutside = bleedBottom;
            bleedTop = bleedBottom;
            epsSpreads = currentINFO.doSpreadsON;
            ignoreSpreadOverrides = theINFO.ignoreON;
            switch (theINFO.dataType){
                case 0:
                    dataFormat = DataFormat.binary;
                    break;
                case 1:
                    dataFormat = DataFormat.ascii;
                    break;
            switch (theINFO.colorType){
                case 0:
                    epsColor = EPSColorSpace.unchangedColorSpace;
                    break;
                case 1:
                    epsColor = EPSColorSpace.gray;
                    break;
                case 2:
                    epsColor = EPSColorSpace.rgb;
                    break;
                case 3:
                    epsColor = EPSColorSpace.cmyk;
                    break;
                case 4:
                    epsColor = EPSColorSpace.postscriptColorManagement;
                    break;
            switch (theINFO.fontEmbed){
                case 0:
                    fontEmbedding = FontEmbedding.none;
                    break;
                case 1:
                    fontEmbedding = FontEmbedding.complete;
                    break;
                case 2:
                    fontEmbedding = FontEmbedding.subset;
                    break;
            switch (theINFO.dataSent){
                case 0:
                    imageData = EPSImageData.allImageData;
                    break;
                case 1:
                    imageData = EPSImageData.proxyImageData;
                    break;
            switch (theINFO.defaultPreview){
                case 0:
                    preview = PreviewTypes.none;
                    break;
                case 1:
                    preview = PreviewTypes.tiffPreview;
                    break;
                case 2:
                    preview = PreviewTypes.pictPreview;
                    break;
            switch (theINFO.psLevel){
                case 0:
                    postScriptLevel = PostScriptLevels.level2;
                    break;
                case 1:
                    postScriptLevel = PostScriptLevels.level3;
                    break;
            // Setting these three to false prevents a conflict error when trying to set the opiImageReplacement value
            omitBitmaps = false;
            omitEPS = false;
            omitPDF = false;
            if (theINFO.opiReplacement){
                opiImageReplacement = true;
            else {
                opiImageReplacement = false;
                omitBitmaps = theINFO.bitmapON;
                omitEPS = theINFO.epsON;
                omitPDF = theINFO.pdfON;
    * Build the main dialog box
    function createMainDialog (docName, thisNum, endNum){
        var theDialog = app.dialogs.add({name:(VERSION_NAME + ": Enter the options for \"" + docName + "\"" + ((endNum==1)?"":" (" + thisNum + " of " + endNum + " documents)") )
    , canCancel:true} );
        with (theDialog){
            // Left Column
            with (dialogColumns.add() ){
                with (dialogRows.add() )
                    staticTexts.add({staticLabel:"Page Naming Options"} );
                with(borderPanels.add() ){
                    with(dialogColumns.add() ){
                        // Radio butons for renaming convention
                        namingConvention = radiobuttonGroups.add();
                        with(namingConvention){
                            radiobuttonControls.add({staticLabel:"As Is", checkedState:(peuINFO.nameConvType == 0)} );
                            radiobuttonControls.add({staticLabel:"Add \".L\"", checkedState:(peuINFO.nameConvType == 1)} );
                            radiobuttonControls.add({staticLabel:"Odd/Even = \".F/.B\"", checkedState:(peuINFO.nameConvType == 2)} );
                            radiobuttonControls.add({staticLabel:"Odd/Even = \"LA.F/LA.B\"" , checkedState:(peuINFO.nameConvType == 3)});
                            radiobuttonControls.add({staticLabel:"Numeric Override" , checkedState:(peuINFO.nameConvType == 4)});
                    with (dialogRows.add() )
                        staticTexts.add({staticLabel:""} );
                        with(dialogRows.add() ){
                        staticTexts.add({staticLabel:"Base Name"} );
                        newBaseName = textEditboxes.add({editContents:baseName, minWidth:100} );
            // Middle Column
            with (dialogColumns.add() ){
                with (dialogRows.add() )
       

    RichardM0701, are you the same person as scottbentley?
    I fear your response doesn't make a lot of sense. The easiest way is to put your files into a book, which will not harm them. The easiest script is often no script at all.
    I don't understand your comment about separate text boxes, files contain text boxes and definitionally multiple files means multiple separate text boxes.
    I do not know what you are referring to with respect to the toc update, perhaps you could reference a particular command or script, or provide a screenshot.
    It sounds like now you are interested in updating multiple tables of contents in a single fell swoop -- this would appear to have nothing to do with the original question. If that's the case, please start a new thread.

  • What's Fixed in Premiere Pro CC2014.2

    As noted in the blog post for the 2014.2 release, while this update includes a few new features, it is chiefly geared toward addressing known issues. The blog post lists the higher profile fixes. Below is is a more comprehensive list.
    Import
    Red frames in MXF clips from a particular model of camera.
    Cannot import ARRI Alexa Open Gate clips
    Import fails for IMX 30 MXF clips stored on certain proprietary media asset management systems. Error: Unsupported format or damaged file.
    Some XDCAM HD Proxy files show red frames
    Some .VOB clips play only audio or shows media pending indefinitely
    Premiere does not recognize timecode for audio-only MXF files written by some third-party programs.
    Only the first frame of video plays for AVC-Intra50 MXF files stored on certain third-party media asset management systems.
    Spanned DVCPRO clips have incomplete audio if an XMP file is present but no media cache/pek file are found.
    Some metadata from an Adobe Clip project does not get correctly logged on import.
    Exporting & Rendering
    Rendering fails for MXF media with Posterize Time effect applied
    ProRes exports can be very slow when smart rendering
    Encoded output can include black frames, corrupted frames, or frames from elsewhere in the sequence
    Canceling export to P2 can result in low-level exception if the sequence duration is greater than a few minutes
    Aspect ratio for IMX 30 widescreen anamorphic encodes is incorrect.
    Edit to Tape: Audio drops out while playing out to tape
    The Height setting for encodes to the GoPro Cineform codec is constrained to multiples of 8.
    Smart Rendering: GoPro 2.7K footage cannot be smart rendered
    AAF
    Distorted audio in AAF exports with 24 bit embed option selected.
    If a multichannel sequence has been nested into 2 channel sequence, then an AAF export yields the number of channels in the nest rather than the 2-channel mix-down
    Certain third-party programs have problems relinking to video with Premiere's AAF exports. (Windows only)
    If the first of two adjacent audio clips has a Fade Out applied, exporting as AAF converts it to a Fade In onthe second clip. (Mac only)
    When AAF exports are opened in some third party apps, audio crossfades are treated as cuts or fade-ins.
    Crash during AAF export if a video clip has multiple effects applied.
    When AAF exports are opened in some third party apps, some audio clips and tracks are incorrect.
    Crash upon exporting to AAF with disabled clips that have cross fades applied
    If a multicam sequence with mono audio is nested onto a stereo or adaptive track, then exporting to AAF yields a stereo clip with the audio panned fully to the left.
    When AAF exports are opened in some third party apps, rendered audio of is relinked automatically, but the video needs to be manually linked.
    Playback
    If a UHD ProRes clip is in an SD sequence an scaled to less than 50%, then scaling is ignored during playback at Full Resolution [GPU acceleration only]
    Poor playback performance with certain third-party I/O hardware on OS X 10.9.
    Crash during playback of R3D content [CUDA GPU acceleration only]
    Audio
    Audio sync is lost with some XDCAM content wrapped in QuickTime reference movie
    Audio sync is lost when user starts scrubbing during playback while using certain I/O hardware.
    When playing past an audio transition, the sound sometimes surges and has pops/clicks introduced
    Audio dropouts, and Events panel reports "audio dropouts detected." [Prefetch purge related]
    Audio dropouts in some scenarios after releasing memory (e.g., cycling focus to another app)[Prefetch-related]
    Shuttling for an extensive time can cause audio dropouts
    Project
    If current user does not have write access to certain folders, the crash error message is uninformative (Mac only)
    In Adobe Anywhere, crash when using keyboard shortcut to open Convert Project to Production dialog or the New Production dialog.
    If multiple clients on a network use the same media cache location, then upon importing a given asset each client writes its own accelerator files.
    The Find features in the Project panel and Timeline cannot search by Korean characters.
    In Search Bins, moving focus by keyboard from one clip to another can cause the tree view to expand to show the bin where the clip is stored.
    Project Manager/Consolidate & Transcode
    If the destination drive has insufficient space, Premiere throws an "unknown error" rather than an informative message.
    Project Manager writes some clips outside of folders
    Consolidate and Transcode does not warn the user if the destination drive has insufficient space.
    Unknown error can result from using Consolidate & Transcode with P2 content in the sequence.
    In some cases, Consolidate & Transcode copies and renames the component assets for merged clips.
    If Exclude Unused Clips is deselected, the components for merged clips sometimes still get copied; if the option is selected, the presence of merged clips can yield Unknown Error.
    If the sequence being transcoded contains overlapping "soft" subclips, then some clips may be missing from the sequence in the consolidated version, and In/Out points may be incorrect for the subclips.
    If Exclude Unused Clips is turned off and the project being transcoded contains "soft" subclips, then the consolidated version of the project does not have transcoded copies of the subclips.
    If a sequence contains only audio from an A/V clip, using Consolidate and Transcode to some presets will fail with unknown error
    If the sequences being transcoded contains two copies of a master clip, one of which was the product of Duplicating or Copying/Pasting in Project panel, the consolidated version of the project has only one instance of the master clip.
    If the project contains multiple master clips for the same asset and Interpret Footage is applied, then the consolidated version will have multiple transcoded copies of the source asset.
    If the transcoded sequence contains a hard subclip (i.e., "Restrict Trims to Subclip Boundaries" enabled), the resulting project item is a master clip rather than a subclip.
    Merged Clips
    Comment markers added to a merged clip get inserted to the component clips, but the Name & Comment entries are not saved.
    Hang on right-clicking the current marker in a merged clip in certain circumstances.
    Editing/Timeline
    Crash on clicking the very bottom of clip in the Timeline and dragging to move the clip. [SubViewImpl.cpp-724]
    Crash on Ripple Trim Previous Edit to Playhead for a clip group when that action completely deletes one of the component clips in the group. (TrackItemGroup.cpp-821)
    Indefinite hang if sequence contains a QuickTime .mov with an unusual framerate and a CEA-708 caption track
    Crash upon creating a sequence from a source with no frame rate specified (e.g., a title imported from a third-party-generated XML)
    If a rendered-and-replaced clip has been trimmed, then Restore Unrendered can result in content being out of sync
    Multicam
    Audio is lost when flattening multicam sequences that were created with dual stereo movies.
    If a multicam clip was created with Switch/mono and placed into stereo tracks, then flattening incorrectly maps the audio channels to stereo, with the right channel disabled.
    Playing a multicam sequence in the Source Monitor can result in an unacceptable ratio of dropped frames.
    Effects & Transitions
    With Warp Stabilizer applied, Program Monitor shows only upper left corner of the frame, sometimes with alternating whole frames [GPU acceleration only]
    Sub-pixel positioning is incorrect for non-linear alpha compositing [GPU acceleration only]
    GPU transitions that depend on other layers cannot access those layers
    Crash upon clicking outside the Direct Manipulation control for some effects.
    Memory leak with certain third-party effects
    Crash on clicking Setup button for some third-party transitions.
    Loudness Radar' Track FX Editor intercepts keystrokes intended for editing titles (e.g., spacebar)
    Crash (Pure Virtual Function Call) on adjusting parameters for some third-party effects.
    Some third-party effects get frames from the wrong time in the clip.
    UI/Workspaces
    All open Project panels get reset to root upon switching between projects that use the same workspace.
    The order of open Timelines sometimes gets jumbled upon closing and reopening the project.
    Bezier handles for keyframe can be nearly invisible at default brightness.
    Closing the Source Monitor when it's showing a scope (e.g., YC Waveform) crashes Premiere (error: CheckBoxControl.cpp-105)
    HTML5 panels do not receive Tab events.
    Redraw errors on maximizing an HTML5 panel.
    Performance (Note: Most of these fixes are also listed under a product area)
    In certain scenarios, performance is unacceptable when doing basic editing operations with waveforms displayed in the Timeline.
    Scrubbing a growing file on an Xsan can result in very high bandwidth usage with some network configurations.
    Playing a multicam sequence in the Source Monitor can result in an unacceptable ratio of dropped frames.
    ProRes exports can be very slow when smart rendering.
    Poor playback performance with certain third-party I/O hardware on OS X 10.9.

    Just in case anyone is interested:
    anyone else having PP crash after the 8.2 update? I keep getting the below error:
    Faulting application name: Adobe Premiere Pro.exe, version: 8.2.0.65, time stamp: 0x5486db4a
    Faulting module name: ntdll.dll, version: 6.1.7601.18247, time stamp: 0x521eaf24
    Exception code: 0xc0000005
    Fault offset: 0x0000000000052f86
    Faulting process id: 0x2168
    Faulting application start time: 0x01d019e6c12de352
    Faulting application path: C:\Program Files\Adobe\Adobe Premiere Pro CC 2014\Adobe Premiere Pro.exe
    Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
    Report Id: 8f518e38-85de-11e4-81e4-1cc1de338660
    I trashed my preferences; rolled back to earlier versions of NVIDIA drivers; cleared out my cache; reinstalled PP 8.2, and uninstalled all 3rd party plugins... I still get the above error. I've since rolled back to 8.1 with no issues. I'd love to get 8.2 to work, since scrubbing thru Gh4 4k files was a lot smoother with this update.
    Specs:
    HP Z800 MC 8.2, Adobe CC 2014, Windows 7 Ultimate 64-bit SP1, 2 Hex Core X5650 @ 2.67GHz, 48Gigs Ram, NVidia Quadro K4000, Sandisk Extreme 240 gig SSD System drive, SATA 4 Tb (Raid 0) media drive, Sata 2 TB export drive , SSD 120GN for cache, 1 G-Tech 2tb Raid export/backup,1 4tb G-drive backup, Matrox MXO2 mini, 850 WATT PSU
    in Premiere Pro • Reply • Like Show 0 Likes(0)

  • Missing version field in response...( Tomcat, JBuilder )

    Hello,
    (Sorry for a long message, but I saw several times messages with the only
    response like "write more details...")
    I'm trying to execute a simple Web Start application using version-based download.
    I'm constantly receiving the following error:
    Missing version field in response from server when accessing resource:
    (http://localhost:8083/checkboxcontrol/CheckBoxControl.jar, 1.1)
    Is it possible that there is a bug somewhere within Web Start ?
    The download is working in a basic version - the problem starts to occur when
    I'm changing JNLP to:
    <jar href="CheckBoxControl.jar" version="1.1"/>
    Is there anybody that can help me ?
    (I've read all past messages about "Missing version field in response...")
    Below is all information about the case.
    URL:
    ===================
    http://localhost:8083/checkboxcontrol/CheckBoxControlLauncher.jnlp
    Software configuration:
    ======================================
    JBuilder 9 Enterprise Trial
    Java Web Start 1.4.2
    Tomcat 4.1 (included for debugging inside the JBuilder)
    Windows NT 4.0 SP6a
    Mozilla Firebird 0.6.1
    Please note that I've tried also with IBM Websphere 4 - the same result.
    JNLP file:
    ===================
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8083/checkboxcontrol">
    <information>
    <title>CheckBox Example</title>
    <vendor>Borland</vendor>
    <homepage href="CheckBoxControlLauncher.html" />
    <description>Web Start Example for CheckBoxControl</description>
    </information>
    <resources>
    <j2se version="1.3+" />
    <jar href="CheckBoxControl.jar" version="1.1"/>
    </resources>
    <application-desc main-class="com.borland.samples.swing.checkboxcontrol.Application1" />
    </jnlp>
    File directory contents:
    ========================
    .\Lib (empty)
    .\WEB-INF
    ->\classes
    ->->\checkboxcontrol
    ->->->\WEB-INF
    ->->->->\Lib
    ->->->->->\jardiff.jar
    ->->->->->\jnlp-servlet.jar
    ->->->->->\jnlp.jar
    ->->\classes\com\borland\samples\swing\checkboxcontrol\
    ->->->\Application1.class
    ->->->\Frame1$1.class
    ->->->\Frame1$2.class
    ->->->\Frame1$3.class
    ->->->\Frame1$4.class
    ->->->\Frame1$5.class
    ->->->\Frame1.class
    ->\lib
    ->->\jardiff.jar
    ->->\jnlp-servlet.jar
    ->->\jnlp.jar
    ->\web.xml
    CheckBoxControl.jar
    CheckBoxControlLauncher.html
    CheckBoxControlLauncher.jnlp
    CheckBoxControl__V1.1.jar
    version.xml
    web.xml contents:
    ===================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>JnlpDownloadServlet</servlet-name>
    <servlet-class>com.sun.javaws.servlet.JnlpDownloadServlet</servlet-class>
    </servlet>
    [... cut ....]
    <servlet-mapping>
    <servlet-name>JnlpDownloadServlet</servlet-name>
    <url-pattern>*.jnlp</url-pattern>
    </servlet-mapping>
    <mime-mapping>
    <extension>jar</extension>
    <mime-type>application/x-java-archive</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jnlp</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    </web-app>
    version.xml contents:
    ======================================
    <jnlp-versions>
    <resource>
    <pattern>
    <name>CheckBoxControl.jar</name>
    <version-id>1.1</version-id>
    </pattern>
    <file>CheckBoxControl.jar</file>
    </resource>
    </jnlp-versions>
    Stack trace:
    ===================
    JNLPException[category: Download Error : Exception: null : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(DownloadProtocol.java:566)
         at com.sun.javaws.cache.DownloadProtocol.getDownloadSize(DownloadProtocol.java:850)
         at com.sun.javaws.LaunchDownload.downloadJarFiles(LaunchDownload.java:580)
         at com.sun.javaws.LaunchDownload.downloadEagerorAll(LaunchDownload.java:544)
         at com.sun.javaws.Launcher.downloadResources(Launcher.java:735)
         at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:291)
         at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
         at com.sun.javaws.Launcher.run(Launcher.java:167)
         at java.lang.Thread.run(Thread.java:534)

    I took a scan through what you posted and it looked OK - it has to be something simple. Sometimes it helps to compare against a working system - try looking at ScheduleWorld's jnlp.

  • Premiere pro cc2014 bugs?

    Hello
    Has anyone updated Premier pro cc 2014 to the latest version. I havent touched it in ages because of all the bugs and constant  crashing but im eager to return to several  CC 2014 projects that I need to start using again.
    Have the bugs been fixed is it worth using again?
    Thanks
    Philip

    Here's a breakdown and he's the link to the original post. There's some feedback from other customers there: What's Fixed in Premiere Pro CC2014.2
    As noted in the blog post for the 2014.2 release, while this update includes a few new features, it is chiefly geared toward addressing known issues. The blog post lists the higher profile fixes. Below is is a more comprehensive list.
    Import
    Red frames in MXF clips from a particular model of camera.
    Cannot import ARRI Alexa Open Gate clips
    Import fails for IMX 30 MXF clips stored on certain proprietary media asset management systems. Error: Unsupported format or damaged file.
    Some XDCAM HD Proxy files show red frames
    Some .VOB clips play only audio or shows media pending indefinitely
    Premiere does not recognize timecode for audio-only MXF files written by some third-party programs.
    Only the first frame of video plays for AVC-Intra50 MXF files stored on certain third-party media asset management systems.
    Spanned DVCPRO clips have incomplete audio if an XMP file is present but no media cache/pek file are found.
    Some metadata from an Adobe Clip project does not get correctly logged on import.
    Exporting & Rendering
    Rendering fails for MXF media with Posterize Time effect applied
    ProRes exports can be very slow when smart rendering
    Encoded output can include black frames, corrupted frames, or frames from elsewhere in the sequence
    Canceling export to P2 can result in low-level exception if the sequence duration is greater than a few minutes
    Aspect ratio for IMX 30 widescreen anamorphic encodes is incorrect.
    Edit to Tape: Audio drops out while playing out to tape
    The Height setting for encodes to the GoPro Cineform codec is constrained to multiples of 8.
    Smart Rendering: GoPro 2.7K footage cannot be smart rendered
    AAF
    Distorted audio in AAF exports with 24 bit embed option selected.
    If a multichannel sequence has been nested into 2 channel sequence, then an AAF export yields the number of channels in the nest rather than the 2-channel mix-down
    Certain third-party programs have problems relinking to video with Premiere's AAF exports. (Windows only)
    If the first of two adjacent audio clips has a Fade Out applied, exporting as AAF converts it to a Fade In onthe second clip. (Mac only)
    When AAF exports are opened in some third party apps, audio crossfades are treated as cuts or fade-ins.
    Crash during AAF export if a video clip has multiple effects applied.
    When AAF exports are opened in some third party apps, some audio clips and tracks are incorrect.
    Crash upon exporting to AAF with disabled clips that have cross fades applied
    If a multicam sequence with mono audio is nested onto a stereo or adaptive track, then exporting to AAF yields a stereo clip with the audio panned fully to the left.
    When AAF exports are opened in some third party apps, rendered audio of is relinked automatically, but the video needs to be manually linked.
    Playback
    If a UHD ProRes clip is in an SD sequence an scaled to less than 50%, then scaling is ignored during playback at Full Resolution [GPU acceleration only]
    Poor playback performance with certain third-party I/O hardware on OS X 10.9.
    Crash during playback of R3D content [CUDA GPU acceleration only]
    Audio
    Audio sync is lost with some XDCAM content wrapped in QuickTime reference movie
    Audio sync is lost when user starts scrubbing during playback while using certain I/O hardware.
    When playing past an audio transition, the sound sometimes surges and has pops/clicks introduced
    Audio dropouts, and Events panel reports "audio dropouts detected." [Prefetch purge related]
    Audio dropouts in some scenarios after releasing memory (e.g., cycling focus to another app)[Prefetch-related]
    Shuttling for an extensive time can cause audio dropouts
    Project
    If current user does not have write access to certain folders, the crash error message is uninformative (Mac only)
    In Adobe Anywhere, crash when using keyboard shortcut to open Convert Project to Production dialog or the New Production dialog.
    If multiple clients on a network use the same media cache location, then upon importing a given asset each client writes its own accelerator files.
    The Find features in the Project panel and Timeline cannot search by Korean characters.
    In Search Bins, moving focus by keyboard from one clip to another can cause the tree view to expand to show the bin where the clip is stored.
    Project Manager/Consolidate & Transcode
    If the destination drive has insufficient space, Premiere throws an "unknown error" rather than an informative message.
    Project Manager writes some clips outside of folders
    Consolidate and Transcode does not warn the user if the destination drive has insufficient space.
    Unknown error can result from using Consolidate & Transcode with P2 content in the sequence.
    In some cases, Consolidate & Transcode copies and renames the component assets for merged clips.
    If Exclude Unused Clips is deselected, the components for merged clips sometimes still get copied; if the option is selected, the presence of merged clips can yield Unknown Error.
    If the sequence being transcoded contains overlapping "soft" subclips, then some clips may be missing from the sequence in the consolidated version, and In/Out points may be incorrect for the subclips.
    If Exclude Unused Clips is turned off and the project being transcoded contains "soft" subclips, then the consolidated version of the project does not have transcoded copies of the subclips.
    If a sequence contains only audio from an A/V clip, using Consolidate and Transcode to some presets will fail with unknown error
    If the sequences being transcoded contains two copies of a master clip, one of which was the product of Duplicating or Copying/Pasting in Project panel, the consolidated version of the project has only one instance of the master clip.
    If the project contains multiple master clips for the same asset and Interpret Footage is applied, then the consolidated version will have multiple transcoded copies of the source asset.
    If the transcoded sequence contains a hard subclip (i.e., "Restrict Trims to Subclip Boundaries" enabled), the resulting project item is a master clip rather than a subclip.
    Merged Clips
    Comment markers added to a merged clip get inserted to the component clips, but the Name & Comment entries are not saved.
    Hang on right-clicking the current marker in a merged clip in certain circumstances.
    Editing/Timeline
    Crash on clicking the very bottom of clip in the Timeline and dragging to move the clip. [SubViewImpl.cpp-724]
    Crash on Ripple Trim Previous Edit to Playhead for a clip group when that action completely deletes one of the component clips in the group. (TrackItemGroup.cpp-821)
    Indefinite hang if sequence contains a QuickTime .mov with an unusual framerate and a CEA-708 caption track
    Crash upon creating a sequence from a source with no frame rate specified (e.g., a title imported from a third-party-generated XML)
    If a rendered-and-replaced clip has been trimmed, then Restore Unrendered can result in content being out of sync
    Multicam
    Audio is lost when flattening multicam sequences that were created with dual stereo movies.
    If a multicam clip was created with Switch/mono and placed into stereo tracks, then flattening incorrectly maps the audio channels to stereo, with the right channel disabled.
    Playing a multicam sequence in the Source Monitor can result in an unacceptable ratio of dropped frames.
    Effects & Transitions
    With Warp Stabilizer applied, Program Monitor shows only upper left corner of the frame, sometimes with alternating whole frames [GPU acceleration only]
    Sub-pixel positioning is incorrect for non-linear alpha compositing [GPU acceleration only]
    GPU transitions that depend on other layers cannot access those layers
    Crash upon clicking outside the Direct Manipulation control for some effects.
    Memory leak with certain third-party effects
    Crash on clicking Setup button for some third-party transitions.
    Loudness Radar' Track FX Editor intercepts keystrokes intended for editing titles (e.g., spacebar)
    Crash (Pure Virtual Function Call) on adjusting parameters for some third-party effects.
    Some third-party effects get frames from the wrong time in the clip.
    UI/Workspaces
    All open Project panels get reset to root upon switching between projects that use the same workspace.
    The order of open Timelines sometimes gets jumbled upon closing and reopening the project.
    Bezier handles for keyframe can be nearly invisible at default brightness.
    Closing the Source Monitor when it's showing a scope (e.g., YC Waveform) crashes Premiere (error: CheckBoxControl.cpp-105)
    HTML5 panels do not receive Tab events.
    Redraw errors on maximizing an HTML5 panel.
    Performance (Note: Most of these fixes are also listed under a product area)
    In certain scenarios, performance is unacceptable when doing basic editing operations with waveforms displayed in the Timeline.
    Scrubbing a growing file on an Xsan can result in very high bandwidth usage with some network configurations.
    Playing a multicam sequence in the Source Monitor can result in an unacceptable ratio of dropped frames.
    ProRes exports can be very slow when smart rendering.
    Poor playback performance with certain third-party I/O hardware on OS X 10.9.

  • Duplicate object into multiple selected frame

    I’m looking for a script that will duplicate the selected object or the content of the clipboard into multiple selected layers inside a document.
    I have not find any discussions around this, but I’m asking if anyone have already seen such script.
    Thanks
    Jean-Claude

    Jean-Claude try the following one:
    1. Should work with a single object, multiple objects, group
    2. Should alert a warning, if you select nothing or select some text
    3. Will not honor, if layers are hidden or locked
    Does it work for you?
    // duplicate on different layers _b02
    // by Kai Rübsamen, credits to Hans Haesler
    // vorbeugenderweise das Anzeigen von Dialogen aktivieren
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    // prüfen, ob ein Dokument geöffnet ist
    if ( app.documents.length == 0 ) {
        alert ( "Warning\rOpen a document!" );
        exit();
    // die Auswahl speichern ...
    var allSel = app.selection;
    var nItems = allSel.length;
    // und prüfen
    if ( !nItems ) {
        alert ( "Warning\rSelect something!" );
        exit();
    if ( nItems == 1 && app.selection[0].hasOwnProperty("baseline") ) {
        alert ( "Warning\rDoes not work with text. Select only frames!" );
        exit();
    var curDoc = app.activeDocument;
    var allLayers = curDoc.layers;
    var nLayers = allLayers.length;
    // eventuell vorhandene Dialoge entfernen
    try {
        app.dialogs.everyItem().destroy();
    catch (e) {
    var layerNames = new Array();
    for ( var i = 0; i < nLayers; i++ ) {
        layerNames.push( allLayers[i].name );
    // eventuell vorhandene Dialoge entfernen
    try {
        app.dialogs.everyItem().destroy();
    catch (e) {
    // den Dialog vorbereiten ...
    var dlogCheckList = new Array();
    var aDialog = app.dialogs.add({ name: "Duplicate object to selected layers", canCancel: true });
    with ( aDialog ) {
        with ( dialogColumns.add() ) {
            with ( dialogRows.add() ) {
                staticTexts.add({ staticLabel: "active = duplicate"} );
                for ( var n = 0; n < nLayers; n++ ) {
                    with (dialogRows.add()) {
                        dlogCheckList.push( checkboxControls.add({ staticLabel: layerNames[n] }));
    // ... anzeigen und die Wahl des Anwenders anwenden
    if ( aDialog.show() == true ) {
        for ( var k = 0; k < dlogCheckList.length; k++ ) {
            var curCheckBox = dlogCheckList[k];
            if ( curCheckBox.checkedState ) {
                var curLayer = curDoc.layers.itemByName( layerNames[k] );
                for ( var i = nItems-1; i >= 0; i-- ) {
                    var curSel = allSel[i];
                    curSel.duplicate( curLayer );
        aDialog.destroy();
    else {
        aDialog.destroy();
    –Kai

  • Script for export all text in single rtf file?

    Hi!
    I need to export all storys from indd document to a single rtf file. Is there avaible some free script for CS4 which can do that?

    if(app.documents.length != 0){
         if(app.documents.item(0).stories.length != 0){
              myGetFileName(app.documents.item(0).name);
    //========================= FUNCTIONS ===========================
    function myGetFileName(myDocumentName){
         var myFilePath = File.saveDialog("Save Exported File As:");
         if(myFilePath != null){
              myDisplayDialog(myDocumentName, myFilePath);
    function myDisplayDialog(myDocumentName, myFilePath){
         //Need to get export format, story separator.
         var myExportFormats = ["Text Only", "Tagged Text", "RTF"];
         var myDialog = app.dialogs.add({name:"ExportAllStories"});
         with(myDialog.dialogColumns.add()){
              with(dialogRows.add()){
                   with(dialogColumns.add()){
                        var myExportFormatDropdown = dropdowns.add({stringList:myExportFormats, selectedIndex:0});
              with(dialogRows.add()){
                   var myAddSeparatorCheckbox = checkboxControls.add({staticLabel:"Add separator line", checkedState:true});
         var myResult = myDialog.show();
         if(myResult == true){
              var myExportFormat = myExportFormats[myExportFormatDropdown.selectedIndex];
              var myAddSeparator = myAddSeparatorCheckbox.checkedState;
              myDialog.destroy();
              myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator);
         else{
              myDialog.destroy();
    function myExportAllText(myDocumentName, myFilePath, myExportFormat, myAddSeparator){
         var myPage, myStory;
         var myExportedStories = [];
         var myTempFolder = Folder.temp;
         var myTempFile = File(myTempFolder + "/tempTextFile.txt");
         var myNewDocument = app.documents.add();
         var myDocument = app.documents.item(myDocumentName);
         var myTextFrame = myNewDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myNewDocument, myNewDocument.pages.item(0))});
         var myNewStory = myTextFrame.parentStory;
         for (var i = 0; i < myDocument.pages.length; i++) {
              myPage = myDocument.pages.item(i);
              for (var t = 0; t < myPage.textFrames.length; t++){
                   myStory = myPage.textFrames[t].parentStory;
                   if (!IsInArray(myStory.id, myExportedStories)) {
                        //Export the story as tagged text.
                        myStory.exportFile(ExportFormat.taggedText, myTempFile);
                        myExportedStories.push(myStory.id);
                        //Import (place) the file at the end of the temporary story.
                        myNewStory.insertionPoints.item(-1).place(myTempFile);
                        //If the imported text did not end with a return, enter a return
                        //to keep the stories from running together.
                        if(i != myDocument.stories.length -1){
                             if(myNewStory.characters.item(-1).contents != "\r"){
                                  myNewStory.insertionPoints.item(-1).contents = "\r";
                             if(myAddSeparator == true){
                                  myNewStory.insertionPoints.item(-1).contents = "----------------------------------------\r";
                   } // if not exported
              } // for text frames
         } // for pages
         switch(myExportFormat){
              case "Text Only":
                   myFormat = ExportFormat.textType;
                   myExtension = ".txt"
                   break;
              case "RTF":
                   myFormat = ExportFormat.RTF;
                   myExtension = ".rtf"
                   break;
              case "Tagged Text":
                   myFormat = ExportFormat.taggedText;
                   myExtension = ".txt"
                   break;
         myNewStory.exportFile(myFormat, File(myFilePath));
         myNewDocument.close(SaveOptions.no);
         myTempFile.remove();
    function myGetBounds(myDocument, myPage){
         var myPageWidth = myDocument.documentPreferences.pageWidth;
         var myPageHeight = myDocument.documentPreferences.pageHeight
         if(myPage.side == PageSideOptions.leftHand){
              var myX2 = myPage.marginPreferences.left;
              var myX1 = myPage.marginPreferences.right;
         else{
              var myX1 = myPage.marginPreferences.left;
              var myX2 = myPage.marginPreferences.right;
         var myY1 = myPage.marginPreferences.top;
         var myX2 = myPageWidth - myX2;
         var myY2 = myPageHeight - myPage.marginPreferences.bottom;
         return [myY1, myX1, myY2, myX2];
    function IsInArray(myString, myArray) {
         for (x in myArray) {
              if (myString == myArray[x]) {
                   return true;
         return false;
    This is a revised version of the script --  not totally tested.
    Kasyan

  • How to make own crop marks in indesign CS5

    Halo Master ..
    I want to make a scrip cropmark own use javascrip..cropmark standard InDesign only
    but I want to add a colorbar itself using PDF File
    I have added a scrip
    function myDisplayDialog(){
        var myDialog = app.dialogs.add({name:"CropMarks"});
        with(myDialog){
    //---------------------yazh---------------------------------
    with(dialogColumns.add()){
                var myColorBarGroup = enablingGroups.add({staticLabel:"Color Bar", checkedState:true});
                with (myColorBarGroup){
                    with(borderPanels.add()){
                        staticTexts.add({staticLabel:"Options:"});
                        with (dialogColumns.add()){
                              var myAllColorlesCheckbox = checkboxControls.add({staticLabel:"&All", checkedState:true});
                        var myTBColorCheckbox = checkboxControls.add({staticLabel:"&Top,Bottom", checkedState:false});
                        var myLRColorCheckbox = checkboxControls.add({staticLabel:"&Left,Right", checkedState:false});
    //---------------------yazh---------------------------------      
    and..
    var myReturn = myDialog.show();
        if (myReturn == true){
            //Get the values from the dialog box.
             //---------------------yazh---------------------------------   
            var myDoColorBar = myColorBarGroup.checkedState;
            var myColorBarAllColor = myColorBarGroup.checkedState;
            var myColorBarTBColor = myColorBarGroup.checkedState;
            var myColorBarLRColor = myColorBarGroup.checkedState;
             //---------------------yazh---------------------------------   
    so the display becomes
    get the master to help me add a scrip for calling a PDF file and adjust the area, such as
    please help me the master
    I am a beginner..
    Thank you
    Yazhi Myi

    Peter Spier,
    I hope they can help
    AlexeyNi thank you very much
    I have seen it .. but I did not find what I was looking for
    scrip that I was looking to put the Color Bar.

  • Why can't I get the value of "checkedState" in ScriptUI?

    I found I can't get checkedState's value recently, and anybody can help me?
    The snippet script is following:
    #target "InDesign-8.0"
    main();
    function main(){
        myInterFace();
        myTeardown();
    function myInterFace(){
        //<fragment>
        var myDialog = app.dialogs.add({name:"Testing", canCancel:true});
        with(myDialog){
            //Add a dialog column.
            with(dialogColumns.add()){
                with(checkboxControls.add()){
                    staticLabel = "Facing Pages";
                    checkedState = true;
                    minWidth = 140;
      if(myDialog.show() == true){
            var mycheckboxControl = app.dialogs.item(0).dialogColumns.item(0).checkboxControls.item(0);
            var pageMarginSetting = new Array;
            pageMarginSetting.push(mycheckboxControl.checkedState);
            alert("testing");
            formattingTemplate(pageMarginSetting);
            myDialog.destroy();
      else{
      myDialog.destroy()
    function formattingTemplate(pageMarginSetting){
        var myFileNameString = "/C_Test_Template.indd"
        var myDoc = app.documents.add({name:myFileNameString});
        with(myDoc.documentPreferences){
            pageHeight = 280;
            pageWidth = 210;
            pageOrientation = PageOrientation.portrait;
            facingPages = pageMarginSetting[0];
            startPageNumber = 1;
        myDoc.save(File(Folder.desktop + myFileNameString));
    function myTeardown(){

    Try declaring the checkbox as a variable up in the dialog construction something like this:
    //====================//
    #target "InDesign-8.0"
    main();
    function main(){
        myInterFace();
    function myInterFace(){
        var myDialog = app.dialogs.add({name:"Testing", canCancel:true});
        with(myDialog){
            //Add a dialog column.
            with(dialogColumns.add()){
                //checkbox as variable
                var myFPCheckbox =checkboxControls.add({staticLabel:"Facing Pages", checkedState:true, minWidth: 140})
                with(myFPCheckbox){
           if(myDialog.show() == true){
                var pageMarginSetting = new Array;
                pageMarginSetting.push(myFPCheckbox.checkedState);
                alert("testing checkbox result=  "+myFPCheckbox.checkedState);
                myDialog.destroy();
      else{
                myDialog.destroy()

  • Declaring var, changing the name

    I have an myArray created from list of master pageItems:
    myDoc.masterSpreads[0].pageItems.everyItem().name.sort());
    I am going to use every of this Array element in my dialog as a
    checkboxControls.add ({staticLabel: myArray[k]});
    At the same time I should declare a variables which will keep user checkedState:  .
    So thats should be myChck_1, myChck_2, ... myChck_n,  - depends on myArray.length - declared.
    How can I declare variables with names changing with counter "k" value?
    Thx

    Let's try to make it clear.
    Given an array of strings—say myNames—the goal is to associate a control (here a checkbox) to each string.
    The first stage is to create each control within the UI container. This can be done easily, as illustrated in the original post:
    // myNames is an array of strings
    var i;
    for( i=0 ; i < myNames.length ; ++i )
       myCheckboxControls.add({ staticLabel: myNames[i] });
    The above code produces the corresponding control objects—instances of CheckboxControl—but it does not provide a convenient way to access these objects using the original index (in myNames). What the author needs is to keep a reference to each control and to have access to each reference the same way he loops through myNames (i.e., by index). Hence, the ideal structure for this is another array.
    The point is that the CheckboxControls.add(...) method returns a reference to the CheckboxControl object  it just created. You can store this reference in a variable, or directly within your destination array.
    In JavaScript, arrays basically behave as regular objects in that you can fill them 'on the fly' using an integer—the index—in the role of the property name. We can therefore develop the initial code as follows:
    // myNames is an array of strings
    var i;
    var destArray = []; // declare an empty Array
    for( i=0 ; i < myNames.length ; ++i )
       destArray[i] = myCheckboxControls.add({ staticLabel: myNames[i] });
    The only improvement is that the reference to each newly created control is registered in destArray.
    > How does one loop through the new array for the names while also looping through the checkbox array?
    In fact, the code loops through an existing array (myNames), builds for each index a control based on myNames[i] and stores the corresponding reference in destArray using the same index. The resulting array is gradually filled during the loop. and the correspondence between destArray and myNames is maintained through a common index.
    Now, given a specific index, k, one can easily access to both the corresponding label (myNames[k]) and the corresponding control state: destArray[k].checkedState.
    @+
    Marc

  • Update required to this script

    Hi,
    This is a script to relink images by changing the names of the files in a folder etc.
    I am using Indesign CS4 and I would appreciate a update of this script to CS4 (previously worked in CS3) it still works in CS4 but not 100%.
    Could you also incorparate one little thing?
    I have a page with multiple link on it. Everytime it updates the links, it asks me to approve every single link updated. I would like the script to have a feature "update all" without having to click "yes" (for approve) a million time when I know the links are all good.
    Here is a copy of the script. ( I notice some is in what seems to be Russian, mainly the top half of the script is in Russian)
    Change Links
    version 3.5
    Relink the images of the document to files with identical names in choosen folder.
    An InDesign CS2-CS3 JavaScript
    OS: Mac OS X, Windows XP
    You use this script at your own fear and risk.
    © 2009 Dmitriy Lapayev ([email protected])
    The script is intended to replace the images of the document on files with identical names
    from selected folder.
    Main tasks:
    1) Replace the missing files of the non-standard "Package Publication",
    including interconnection transfers projects like: "Windows" to "MAC OS X" or from "MAC OS X" to "Windows";
    2) The substitution of the preliminary document images on the processed files
    with unchanged proportions of the height and width
    (without the “Crop Image” and changes “Canvas Size”).
    In parentheses elements of the dialog indicates the number of found objects of this type.
    When launched, need select a folder, which contains the files that are intended to replace in the document.
    Realized:
    • choice of language when you first start: Russian or English
    (full support of the Russian language is available only for OS Windows)
    • extraction of embedded image files of the document;
    • check the attribute «nonprinting»;
    • search for types of document images;
    • search for files extensions in the selected folder;
    • Unlock Position for groups and objects to the replacement of files;
    • save the settings and selected folder path in the ini-file
    (created when you first run the script).
    Relink images:
    1) stored the geometric coordinates of images (Geometric Bounds), if not choosed
    settings: Center Content, Scale 100% or Angles 0 °;
    preservation of Geometric Bounds (top left and bottom right points) of the original image
    is intended to replace the links to images with unchanged proportions of the height and width
    (without «crop» - Crop Image and resizing - Canvas Size);
    2) ignored:
    • files with duplicate names (with the extension) -
    when you change the type of files «identical», without an extension -
    with the replacement for the selected type, complete with different full file names;
    • outside pages images (PB);
    • images posted from the clipboard (without link).
    Скрипт предназначен для замещения связанных файлов документа
    на файлы с аналогичными именами в выбранной папке.
    Базовые задачи:
    1) восстановление потерянных связей с файлами
    нестандартных «сборок проектов» (Package Publication) при переносе, включая межсистемный;
    2) замещение предварительных изображений в документе на обработанные.
    В круглых скобках элементов диалога настроек скрипта указывается количество найденных
    объектов данного типа.
    При запуске скрипта выбирается папка, которая содержит файлы, предназначенные
    для замещения в документе.
    Настройки скрипта:
    1) выбор изображений документа по состоянию связи с файлом;
    2) диапазон страниц замещения изображений, задается именами страниц и секциями документа
    (выбор секции обладает большим приоритетом);
    3) «Режим пошаговой замены» - Step Mode:
    • установка Center Content - размещать изображение по центру фрейма (контейнера);
    • установка Scale 100% - вертикальному и горизонтальному масштабированию изображения
    присваивается значение 100%;
    • установка Angles 0° – углам вращения и горизонтального сдвига присваивается значение 0°;
    • установка Check Rotate 90° - проверка вращение изображения (±90°),
    при обнаружении несоответствия отношения вертикального и горизонтального масштабов
    исходного и обработанного изображений;
    • установка Clipping Path to None – отключать «обтравочный» путь;
    • установка Check Transparency - проверка параметров прозрачности изображений и фреймов
    (Blending Settings: Opacity < 100%, Blending Mode - не «Normal»);
    4) Including Non-printing Objects - включая объекты с атрибутом «не печатать»
    при замещении связей с файлами;
    5) «Choice of File Extensions:» - выбор типов связанных файлов документа
    для замены в заданном диапазоне страниц;
    6) «File Names:» - установки для сопоставления имен исходных и найденных в выбранной папке файлов,
    если имена файлов не совпадают («неидентичные» - «Non-identical»):
    • «The End of File Name:» - выбор окончания имени файла, содержащего более одного символа «точка»;
    • «Choice of File Extensions:» - выбор расширения файлов в указанной папке;
    7) «Show Relink Report» - формирование и отображение отчета замещения связей с файлами.
    Реализовано:
    • выбор языка интерфейса скрипта при первом запуске: русский или английский
    (полная поддержка русского языка доступна только на ОС «Windows»)
    • извлечение внедренных файлов изображений документа;
    • проверка атрибута «не печатать»;
    • поиск типов связанных файлов документа;
    • поиск расширений файлов в выбранной папке;
    • Unlock Position для групп и объектов при замещении файлов;
    • сохранение настроек и пути к выбранной папке в файле инициализации
    (создается при первом запуске скрипта).
    При замещении изображений:
    1) сохраняются геометрические координаты изображений – Geometric Bounds, если не установлено
    в настройках: Center Content, Scale 100% или Angles 0°;
    сохранение Geometric Bounds (верхняя левая и нижняя правая точки) исходного изображения
    предназначено для замещения на связи с файлами при неизменных пропорциях высоты
    и ширины изображений, т.е. без «кадрирования» - Crop Image и изменения размера - Canvas Size;
    2) игнорируются:
    • файлы с дублирующимися именами с расширением - при замене на тип файлов «идентичный»,
    без расширения - при замене на выбранный тип, при отличающихся полных именах файлов;
    • изображения, находящиеся вне страниц документа (PB);
    • изображения, помещенные из буфера обмена (отсутствует связь с файлом).
    © 2009 Дмитрий Лапаев ([email protected])
    with (app) {
    const myScrVer = "3.5";
    const myScrName = "Change Links";
    // максимальная величина допуска отношений горизонтального и вертикального масштабов изображений
    const myVGScDop = 0.01;
    // copyright
    var mn = "\u00A9\ \u0044\u006D\u0069\u0074\u0072\u0069\u0079\ \u004C\u0061\u0070\u0061\u0079\u0065\u0076";
    // User Interaction Level
    scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    // создание файла инициализации
    const IniFName = "ChLinks_ini.txt";
    var MyStrIniF = "";
    var lgclIniF = new File (activeScript.path + "/" + IniFName);
    if (!lgclIniF.exists) {
      // Выбор языка интерфейса
      var s_Locale = "";
      var myLanguageSelectDialog = dialogs.add({name: "Select Language (" + $.locale + ")", canCancel: false})
      with (myLanguageSelectDialog.dialogColumns.add().borderPanels.add()) {
       var languagesNames = new Array ("Русский", "English");
       var languagesSelect = dropdowns.add({stringList:languagesNames, selectedIndex: 0, minWidth: 160});
      myLanguageSelectDialog.show();
      switch (languagesSelect.selectedIndex) {
       case 0: s_Locale = "ru"; break;
       case 1: s_Locale = "ua"; break;
       case 2: s_Locale = "en"; break;
      myLanguageSelectDialog.destroy();
      MyStrIniF += "var inScriptName = \"" + myScrName + " " + myScrVer + "\";\n";
      MyStrIniF += "var inpVLinkStM = 0;\n";
      MyStrIniF += "var inpDefPath = \"\";\n";
      MyStrIniF += "var inStepMode = true;\n";
      MyStrIniF += "var inShowReport = true;\n";
      MyStrIniF += "var inClippPathNone = false;\n";
      MyStrIniF += "var inCenterCont = false;\n";
      MyStrIniF += "var inScale100 = false;\n";
      MyStrIniF += "var inAngles0 = false;\n";
      MyStrIniF += "var inCheckRotImage = false;\n";
      MyStrIniF += "var inpOrdDotN = true;\n";
      MyStrIniF += "var inpNotIdcl = true;\n";
      MyStrIniF += "var inpInSec = false;\n";
      MyStrIniF += "var inCheckTransp = false;\n";
      MyStrIniF += "var inNonprintIm = true;\n";
      MyStrIniF += "var sel_Language = \"" + s_Locale + "\";\n";
      MyStrIniF += "const mn = \"" + mn + "\";";
      lgclIniF.open("w");
      if (lgclIniF.write(MyStrIniF)) {
       alert (IniFName + " successfully created!\n(Default Script Options)", myScrName + " " + myScrVer, false);
       lgclIniF.close();
       eval ("//@include \'" + IniFName + "\';");
      else {alert("Unable to write the ini-file!"); exit();}
    else {eval ("//@include \'" + IniFName + "\';"); cr();}
    // тип файловой системы (ОС)
    var WonFS = File.fs;
    if (WonFS == "Macintosh") {WonFS = "Mac OS X";}
    // язык интерфейса
    $.localize = true;
    $.locale = sel_Language;
    const copyRight = localize ({ru: "\u00A9\ Дмитрий Лапаев", en: mn});
    const local_Folder = localize ({ru: "Папка: ", en: "Folder: "});
    const local_inFolder = localize ({ru: "папке: ", en: "a Folder: "});
    const local_In = localize ({ru: " в ", en: " in "});
    const local_To = localize ({ru: " на ", en: " to "});
    const local_FNames = localize ({ru: "имена файлов", en: "names"});
    const local_Report = localize ({ru: "Отчет замещения файлов", en: "Relink Report"});
    const local_Relink = localize ({ru: "Заменить", en: "Relink"});
    const local_Found= localize ({ru: "Найдено", en: "Found"});
    const local_inSections = localize ({ru: "cекциях", en: "sections"});
    const local_Total = localize ({ru: "Всего: ", en: "Total: "});
    const local_Links= localize ({ru: "связей с файлами", en: "Links"});
    const local_Files = localize ({ru: "-файлы", en: "-files"});
    const local_LinkStatus = localize ({ru: "состояние связей -", en: "link status -"});
    const local_OfSectionsN = localize ({ru: " cекции №", en: " of section #"});
    const local_OfDocument = localize ({ru: " документа", en: " of document"});
    const local_Conditions = localize ({ru: "Условия замещения:", en: "Conditions:"});
    const local_ApplyChanges = localize ({ru: "Сохранить изменения?", en: "Apply Changes?"});
    const local_ContinueRelink = localize ({ru: "Продолжить замещение файлов?", en: "Continue Relink Files?"});
    const local_RepInf_1 = localize ({ru: "успешно заменено", en: "Successfully relink"});
    const local_RepInf_2 = localize ({ru: "отсутствуют в папке", en: "Links to not existing files"});
    const local_RepInf_3 = localize ({ru: "игнорировано из-за дубликата имени", en: "Ignored links with duplicates of names"});
    const local_RepInf_4 = localize ({ru: "отменено пользователем", en: "Canceled by user"});
    const local_RepInf_5 = localize ({ru: "объекты \"не для печати\"", en: "Оbjects with attribute \"Nonprinting\""});
    // надписи диалогов
    const RotateLabel = localize ({ru: "Вращать", en: "Rotate"});
    const ChoiceFileFormatsLabel = localize ({ru: "Выбор форматов файлов:", en: "Choice of File Formats:"});
    const FileNameLabel = localize ({ru: "Имена файлов:", en: "File Names:"});
    const PageRangeLabel = localize ({ru: "Диапазон страниц:", en: "Range of Pages:"});
    const EndPageNameLabel = localize ({ru: "Окончание имени:", en: "The End of File Name:"});
    const ChoiceExtLabel = localize ({ru: "Выбор типа файлов:", en: "Choice of File Extensions:"});
    var nameNCE =  "identical";
    if (WonFS == "Windows") {nameNCE =  localize ({ru: "идентичные", en: nameNCE});}
    var nameNon =  "Non-";
    if (WonFS == "Windows") {nameNon =  localize ({ru: "не", en: nameNon});}
    var selShowPeport = "Show Relink Report";
    if (WonFS == "Windows") {selShowPeport = localize ({ru: "Отобразить отчет", en: selShowPeport});}
    var selSections = "Sections:";
    if (WonFS == "Windows") {selSections = localize ({ru: "Cекции документа:", en: selSections});}
    var selFDot = "First Dot";
    if (WonFS == "Windows") {selFDot = localize ({ru: "первая точка", en: selFDot});}
    var selLastDot = "Last Dot";
    if (WonFS == "Windows") {selLastDot = localize ({ru: "последняя точка", en: selLastDot});}
    var selStepMode = "Step Mode";
    if (WonFS == "Windows") {selStepMode = localize ({ru: "Режим пошаговой замены", en: selStepMode});}
    var selFitCenter = "Center Content";
    if (WonFS == "Windows") {selFitCenter = localize ({ru: "по центру фрейма", en: selFitCenter});}
    var selVHScale100 = "Scale 100%";
    if (WonFS == "Windows") {selVHScale100 = localize ({ru: "масштаб 100%", en: selVHScale100});}
    var selAngles0 = "Angles 0°";
    if (WonFS == "Windows") {selAngles0 = localize ({ru: "углы 0°", en: selAngles0});}
    var selСhRotate90 = "Check Rotate 90°";
    if (WonFS == "Windows") {selСhRotate90 = localize ({ru: "проверять вращение на 90°", en: selСhRotate90});}
    var selClippingPathNone = "Clipping Path to None";
    if (WonFS == "Windows") {selClippingPathNone = localize ({ru: "отключать обтравочный путь", en: selClippingPathNone});}
    var selChTransparency = "Check Transparency";
    if (WonFS == "Windows") {selChTransparency = localize ({ru: "проверять прозрачность", en: selChTransparency});}
    var selNonprintingImages = "Including Non-printing Objects";
    if (WonFS == "Windows") {selNonprintingImages = localize ({ru: "Включая объекты не для печати", en: selNonprintingImages});}
    var selRotate90CW = "90° CW";
    if (WonFS == "Windows") {selRotate90CW = localize ({ru: "90° по часовой стрелке", en: selRotate90CW});}
    var selRotate90CCW = "90° CCW";
    if (WonFS == "Windows") {selRotate90CCW = localize ({ru: "90° против", en: selRotate90CCW});}
    // массив выбора состояний связей
    var inpVLinkStArr = new Array();
    if (WonFS == "Windows") {
      inpVLinkStArr = [[localize ({ru: "отсутствующие", en: "Missing"}), false], [localize ({ru: "нормальные", en: "Normal"}), false], [localize ({ru: "модифицированные", en: "Modified"}), false], [localize ({ru: "все связи", en: "All Links"}), false]];
    else {
      inpVLinkStArr = [["Missing", false], ["Normal", false], ["Modified", false], ["All Links", false]];
    inpVLinkStArr[inpVLinkStM][1] = true;
    // сообщения скрипта
    var alertWithoutLink = localize ({ru: "Объект без связи с файлом!\n(импортирован из буфера обмена)\nПродолжить работу?", en: "Object without link!\n(imported from clipboard)\nContinue?"});
    var alertAfterRotateSAngle = localize ({ru: "Угол горизонтального сдвига изображения равен", en: "The skewing angle applied to the Image is"});
    var alertAfterRotateSA0 = localize ({ru: "После поворота изображения это значение будет некорректным!\nУстановить 0°?", en: "After rotate this value is incorrect!\nSet Shear Angle to 0°?"});
    var alertNonprinting = localize ({ru: "Найден объект:", en: "Non-printing Object:"});
    var alertNonprintToOff = localize ({ru: "Отключить атрибут \"не для печати\"?", en: "Set attribute \"Nonprinting\" to Off?"});
    var alertEmbedded = localize ({ru: "внедренных изображений", en: "embedded files"});
    var alertUnembed = localize ({ru: "Сохранить внедренные изображения?", en: "Unembed this files?"});
    var alertAlreadyExist = localize ({ru: "уже существует в указанной папке.\nПерезаписать этот файл?", en: "already exist in the folder.\nDo you want to overwrite the file with the embedded data?"});
    var alertСreateNewFolder = localize ({ru: "Выберите папку для сохранения файлов", en: "Select the Folder where files will be created"});
    var alertNotMatchLinks = localize ({ru: "Не найдено соответствующих связей с файлами!", en: "No matching Links!"});
    var alertlEmptyFolder = localize ({ru: "пустая\nили содержит недопустимые символы в имени!\n(только для Mac OS X)", en: "is empty\nor contains illegal characters in its name!\n(Mac OS X)"});
    var alertNotFoundImages = localize ({ru: "Не найдено файлов в папке:", en: "Сannot Find Files in a Folder:"});
    var selFolderWithImages = localize ({ru: "Выберите папку с файлами для замещения в документе", en: "Select a Folder with files for Relink"});
    var andTryAgain =  localize ({ru: "и выполните скрипт повторно.", en: "and try again."});
    var noSaveDocumentAlert =  localize ({ru: "Пожалуйста сохраните документ ", en: "Please Save "});
    var noLinks = localize ({ru: "В открытом документе нет связанных файлов!", en: "No Links in Document!"});
    var noOpenDocsAlert = localize ({ru: "Отсутствуют открытые документы!\nПожалуйста откройте документ", en: "No Documents are Open!\nPlease Open a Document"}) + " " + andTryAgain;
    $.locale = null;
    // проверка открытых документов
    if (documents.length == 0) {alert (noOpenDocsAlert, inScriptName, false); exit();}
    var myDoc = activeDocument;
    try {activeDocument.filePath}
    catch (error) {alert (noSaveDocumentAlert + myDoc.name + " " + andTryAgain, inScriptName, false); exit();}
    if (myDoc.links.length == 0) {alert (noLinks, inScriptName, false); exit();}
    // версия InDesign
    try {const InDver = version.substr (0, 5);}
    catch (error) {alert (inScriptName + "\nis not compatible with this version of InDesign!", "", true); exit();}
    // количество страниц в документе
    var myDocPgsLength = myDoc.pages.length;
    // выбор папки с изображениями
    var myNIdir = Folder.selectDialog (selFolderWithImages, inpDefPath);
    if (myNIdir != null) {var MyNewDir = myNIdir; }
    else {exit();}
    // определяем расширения файлов выбранной папки, исключаем системные
    var MyFiles = MyNewDir.getFiles("*");
    if (MyFiles.length == 0) {
      alert(local_Folder + "\'" + Folder.decode(MyNewDir.name) + "\' " + alertlEmptyFolder, inScriptName, false);
      exit();
    // типы расширений файлов в выбранной папки
    var NewImagesExtType = new Array();
    NewImagesExtType =  ExtenSysCheck (MyFiles);
    if (NewImagesExtType.length == 0) {
      alert (alertNotFoundImages + " \'" + Folder.decode(MyNewDir.name) + "\'!", inScriptName, false);
      exit();
    // заполняем массив типов изображений документа
    var DocSelType = new Array();
    var TypeFileMyDoc = GetFileTypeInDoc (myDoc);
    for (var objCounter = 0; objCounter < TypeFileMyDoc.length; objCounter++) {
      DocSelType.push ([true, TypeFileMyDoc[objCounter][0]]);
    // считаем связи с файлами по состояниям
    var myLinksCounters = myDocLinksCounters(myDoc);
    var ArrStatusL = new Array();
    for (objCounter = 0; objCounter < 4; objCounter++) {
      ArrStatusL.push("(" + myLinksCounters[objCounter] + ") ");
    // имена первой и последней страниц документа
    var DocNumberPageStart = myDoc.pages[0].name;
    var DocNumberPageEnd = myDoc.pages[myDocPgsLength-1].name;
    // массив параметров секций
    var ASecPar = SecRangeOfPages (myDoc);
    // Диалог
    var myDialog = dialogs.add({name: inScriptName + " (InDesign " + InDver + " on " + WonFS + ")  " + copyRight});
    var myCheckArray = new Array();
    with (myDialog.dialogColumns.add().dialogRows.add()) { 
      with (borderPanels.add().dialogColumns.add()) {
       // панель выбора изображений документа по типу состояния связи с файлом
       with (dialogRows.add()) {
        staticTexts.add({staticLabel: local_Relink + ":"});
        var myDocLinksSatus = radiobuttonGroups.add();
        for (var StC = 0; StC < inpVLinkStArr.length; StC++) {
         myDocLinksSatus.radiobuttonControls.add({staticLabel: ArrStatusL[StC] + inpVLinkStArr[StC][0], checkedState: inpVLinkStArr[StC][1]});
       // панель выбора диапазона страниц
       with (borderPanels.add().dialogColumns.add()) {
        dialogRows.add().staticTexts.add({staticLabel: PageRangeLabel});
        // задаем имена первой и последней страниц документа
        with(dialogRows.add()) {
         var PageRangeStart = dialogColumns.add().textEditboxes.add({editContents:DocNumberPageStart, minWidth: 90});
         var PageRangeEnd = dialogColumns.add().textEditboxes.add({editContents:DocNumberPageEnd, minWidth: 90});
        var myReportTotalPages  = local_Total + myDocPgsLength;
        if (ASecPar.length > 1) {myReportTotalPages += local_In + ASecPar.length + " " + local_inSections;}
        dialogRows.add().staticTexts.add({staticLabel: myReportTotalPages});
        // секции документа
        var SecNSelect = 0;
        if (ASecPar.length > 1) {
         var MySelNumbSection = dialogRows.add().enablingGroups.add({staticLabel: selSections, checkedState: inpInSec});
         var SecNList = new Array();
         var nSecPx = "";
         var mySecRange;
         with (MySelNumbSection) {
          for (objCounter = 0; objCounter < ASecPar.length ; objCounter++) {
           if (ASecPar[objCounter][1]  == true) {nSecPx = ASecPar[objCounter][2];}
           else {nSecPx = "";}
           mySecRange = nSecPx + ASecPar[objCounter][3] + "-" + nSecPx + (ASecPar[objCounter][3]+ASecPar[objCounter][4]-1);
           SecNList.push((objCounter+1) + "\| " + mySecRange);
          SecNSelect = dropdowns.add({stringList: SecNList, selectedIndex: 0, minWidth: 165});
       // пошаговый режим
       var MyStepByStepMode = dialogRows.add().enablingGroups.add({staticLabel: selStepMode, checkedState: inStepMode});
       with (MyStepByStepMode.dialogColumns.add()) {
        var myCenterContent = checkboxControls.add({staticLabel: selFitCenter, checkedState: inCenterCont, minWidth: 191});
        with (dialogRows.add()) {
         var myScale100 = checkboxControls.add({staticLabel: selVHScale100, checkedState: inScale100});
         var myAngles0 = checkboxControls.add({staticLabel: selAngles0, checkedState: inAngles0});
        var myPossRotateIm = checkboxControls.add({staticLabel: selСhRotate90, checkedState: inCheckRotImage});
        var myClippPathNone = checkboxControls.add({staticLabel: selClippingPathNone, checkedState: inClippPathNone});
        var myChTransparency = checkboxControls.add({staticLabel: selChTransparency, checkedState: inCheckTransp});
       var myNonprintImagesRelink = checkboxControls.add({staticLabel: selNonprintingImages, checkedState: inNonprintIm});
      // панель выбора типов файлов документа для замены
      with (borderPanels.add().dialogColumns.add()) {
       with(borderPanels.add().dialogColumns.add()) {
        dialogRows.add().staticTexts.add({staticLabel: ChoiceFileFormatsLabel});
        for (objCounter = 0; objCounter < TypeFileMyDoc.length; objCounter++)
        myCheckArray[objCounter] = checkboxControls.add ({staticLabel: Str_inskbk(TypeFileMyDoc[objCounter][0]) + " (" + TypeFileMyDoc[objCounter][1] + ")", checkedState: true, minWidth: 180});
       dialogRows.add().staticTexts.add({staticLabel: FileNameLabel});
       var MyTypeNFname = dialogRows.add().enablingGroups.add({staticLabel: nameNon + nameNCE, checkedState: inpNotIdcl});
       with (MyTypeNFname.dialogColumns.add()) {
        // панель выбора окончания имени файла (для имен связанных файлов с несколькими точками в имени)
        with(borderPanels.add().dialogColumns.add()) {
         dialogRows.add().staticTexts.add({staticLabel: EndPageNameLabel});
         var myDotFLord = dialogRows.add().radiobuttonGroups.add();
         myDotFLord.radiobuttonControls.add({staticLabel: selFDot, checkedState: inpOrdDotN, minWidth: 155});
         myDotFLord.radiobuttonControls.add({staticLabel: selLastDot, checkedState: !inpOrdDotN});
        // панель выбора расширений файлов, найденных в папке
        with(borderPanels.add().dialogColumns.add()) {
         dialogRows.add().staticTexts.add({staticLabel: ChoiceExtLabel});
         var MyTypesForChange = new Array();
         for (objCounter = 0; objCounter < NewImagesExtType.length; objCounter++)
         MyTypesForChange.push("." + NewImagesExtType[objCounter]);
         var myNewImagesExtSelect = dropdowns.add({stringList:MyTypesForChange, selectedIndex: 0, minWidth: 155});
         dialogRows.add().staticTexts.add({staticLabel: local_Found + local_In + local_inFolder + NewImagesExtType.length}); 
       var myShowReportRelink = checkboxControls.add({staticLabel: selShowPeport, checkedState: inShowReport});
    // отображаем диалог
    var myResult = myDialog.show();
    if (!myResult) {myDialog.destroy(); exit();}
    // переменные выбранных установок
    var myIndexButLinksSt = myDocLinksSatus.selectedButton;
    var myButFirstDotName = false;
    if (myDotFLord.selectedButton == 0) {myButFirstDotName = true;}
    var selSectPR = inpInSec;
    try {selSectPR = MySelNumbSection.checkedState;}
    catch (e){}
    var selChTransp = myChTransparency.checkedState;
    var selScale_100 = myScale100.checkedState;
    var selAngles_0 = myAngles0.checkedState;
    var selCenterCont = myCenterContent.checkedState;
    var selChRotate = myPossRotateIm.checkedState;
    var selClipPathNone = myClippPathNone.checkedState;
    var selStepMode = MyStepByStepMode.checkedState;
    var MyNDirAbsURI = MyNewDir.absoluteURI;
    // записываем выбранные установки в файл инициализации
    MyStrIniF = "var inScriptName = \"" + myScrName + " " + myScrVer + "\";\n";
    MyStrIniF += "var inpVLinkStM = " + myIndexButLinksSt + ";\n";
    // MyStrIniF += "var inpDefPath = \"" + MyNDirAbsURI.substr(0, MyNDirAbsURI.lastIndexOf("/")) + "\";\n";
    MyStrIniF += "var inpDefPath = \"" + MyNDirAbsURI + "\";\n";
    MyStrIniF += "var inStepMode = " + selStepMode + ";\n";
    MyStrIniF += "var inShowReport = " + myShowReportRelink.checkedState + ";\n";
    MyStrIniF += "var inClippPathNone = " + selClipPathNone + ";\n";
    MyStrIniF += "var inCenterCont = " + selCenterCont + ";\n";
    MyStrIniF += "var inScale100 = " + selScale_100 + ";\n";
    MyStrIniF += "var inAngles0 = " + selAngles_0 + ";\n";
    MyStrIniF += "var inCheckRotImage = " + selChRotate + ";\n";
    MyStrIniF += "var inpOrdDotN = " + myButFirstDotName + ";\n";
    MyStrIniF += "var inpNotIdcl = " + MyTypeNFname.checkedState + ";\n";
    MyStrIniF += "var inpInSec = " + selSectPR + ";\n";
    MyStrIniF += "var inCheckTransp = " + selChTransp + ";\n";
    MyStrIniF += "var inNonprintIm = " + myNonprintImagesRelink.checkedState + ";\n";
    MyStrIniF += "var sel_Language = \"" + sel_Language + "\";\n";
    MyStrIniF += "const mn = \"" + mn + "\";";
    lgclIniF.open("w");
    if (lgclIniF.write(MyStrIniF)) {lgclIniF.close();}
    else {alert ("Error writing to the ini-file!", inScriptName, true);}
    // переменные диапазона страниц для поиска изображений
    var PRSedcont = PageRangeStart.editContents;
    var PREedcont = PageRangeEnd.editContents;
    var mySelSecStartAbs = 0;
    var mySelSecEndsAbs = myDocPgsLength;
    if (ASecPar.length > 1 && selSectPR == true) {
      SecNSelect = SecNSelect.selectedIndex;
      mySelSecStartAbs = ASecPar[SecNSelect][0];
      mySelSecEndsAbs = mySelSecStartAbs + ASecPar[SecNSelect][4];
    // присваиваем выбранный тип для замещения
    var mySelectedExt ;
    var ResIndexSelectExt = myNewImagesExtSelect.selectedIndex ;
    if (MyTypeNFname.checkedState == false) {mySelectedExt = nameNCE;}
    else {mySelectedExt = NewImagesExtType[ResIndexSelectExt];}
    var mySTdocStr = new Array();
    // выбранные для замещения типы документа
    for (objCounter = 0; objCounter < DocSelType.length; objCounter++) {
      DocSelType[objCounter][0] = myCheckArray[objCounter].checkedState;
      if (DocSelType[objCounter][0] == true) mySTdocStr.push(Str_inskbk(DocSelType[objCounter][1]));
    // формируем массив изображений документа по установленным условиям
    var MyGraphicsPages = new Array();
    // выборка всех изображений из заданного диапазона страниц
    MyGraphicsPages = RangePagesGraphics (myDoc, PRSedcont, PREedcont, selSectPR, mySelSecStartAbs, mySelSecEndsAbs);
    PRSedcont = MyGraphicsPages[1]
    PREedcont = MyGraphicsPages[2];
    // массив имен файлов изображений с атрибутом "не печатать"
    var myImagesWithANonpr = new Array();
    // удаляем (при выборе в диалоге) изображения с атрибутом "не печатать"
    MyGraphicsPages = myPrint_ObjArray (MyGraphicsPages[0], MyStepByStepMode.checkedState, myNonprintImagesRelink.checkedState, myImagesWithANonpr)
    // выбираем по статусу состояния связи с файлом изображения
    MyGraphicsPages = selMissNormModAll_Links (MyGraphicsPages, myIndexButLinksSt);
    // выборка по обозначенным типам изображений
    MyGraphicsPages = getTypeRastrImages (MyGraphicsPages, DocSelType);
    // удаляем файлы с дублирующимися именами при разных путях
    MyGraphicsPages =  FindDuplicatesNames (MyGraphicsPages, mySelectedExt, myButFirstDotName);
    if (MyGraphicsPages.length == 0) {
      alert (alertNotMatchLinks, inScriptName, false);
      myDialog.destroy();
      exit();
    // переподстановка выбранных файлов:
    var beRotate = false;
    var ResRelinkErr = SelectedFiles_Relink (MyGraphicsPages, MyNDirAbsURI, mySelectedExt);
    // отчет
    ResRelinkErr.push(myImagesWithANonpr);
    if (myShowReportRelink.checkedState) {ReportErrorsRelink (ResRelinkErr, inpVLinkStArr[myIndexButLinksSt][0], PRSedcont, PREedcont, SecNSelect, selSectPR, mySTdocStr);}
    myDialog.destroy();
    exit();
    /* ФУНКЦИИ•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• •••••••••••••••••••••••••••••••••••••••••••••••*/
    /* Функция возвращает массив счетчиков изображений документа по состоянию связи с файлом.
    Внедренные файлы предлагается извлечь в выбранную папку. */
    function myDocLinksCounters (inDDoc) {
    var aDocLinksL = inDDoc.links.length;
    var ArrLinksCount = new Array(0, 0, 0, aDocLinksL);
    var myEmbeddedLinks = new Array();
    for (var linkCounter = 0; linkCounter < aDocLinksL; linkCounter++) {
      if (inDDoc.links[linkCounter].status == LinkStatus.linkMissing) ArrLinksCount[0]++;
      if (inDDoc.links[linkCounter].status == LinkStatus.normal) ArrLinksCount[1]++;
      if (inDDoc.links[linkCounter].status == LinkStatus.linkOutOfDate) ArrLinksCount[2]++;
      if (inDDoc.links[linkCounter].status == LinkStatus.linkEmbedded) myEmbeddedLinks.push(inDDoc.links[linkCounter]);
    // для внедренных изображений
    if (myEmbeddedLinks.length > 0) {
      if (confirm (local_Found + " " + alertEmbedded + ": " + myEmbeddedLinks.length + "\n" + alertUnembed, "", inScriptName)) {
       // выбор папки
       var myUnmDir = Folder.selectDialog (alertСreateNewFolder, inDDoc.filePath);
       if (myUnmDir != null) {
        var MyNewUnembedDir = myUnmDir.absoluteURI; 
        for (linkCounter = 0; linkCounter < myEmbeddedLinks.length; linkCounter++){
         // если файл с таким же именем существует
         if (File(MyNewUnembedDir + "/" + myEmbeddedLinks[linkCounter].name).exists) {
          if (confirm (myEmbeddedLinks[linkCounter].name + " " + alertAlreadyExist, "", inScriptName)) {
           myEmbeddedLinks[linkCounter].unembed(Folder(MyNewUnembedDir));
           ArrLinksCount[1]++;
         else {
          myEmbeddedLinks[linkCounter].unembed(Folder(MyNewUnembedDir));
          ArrLinksCount[1]++;
    return ArrLinksCount;
    /* Функция удаляет из массива myObjArray изображения с атрибутом "не печатать"
    при myNonPrImSeld = false. При пошаговом режиме предлагается снять атрибут "не печатать"
    с изображений массива myObjArray.
    Формируется массив изображений с атрибутом "не печатать" myArrayNonprintingIm для отчета. */
    function myPrint_ObjArray(myObjArray, myStepModeTrue, myNonPrImSeld, myArrayNonprintingIm) {
    var myPrintObjArray= new Array();
    var myObjPr;
    for (var myCobj = 0; myCobj < myObjArray.length; myCobj++) {
      myObjPr = myObjArray[myCobj];
      if (myNonprint_ParentRe(myObjPr)) { 
       if(myStepModeTrue) {
        myObjPr.itemLink.show();
        if (confirm(alertNonprinting + " " + myObjPr.itemLink.name + "\n" + alertNonprintToOff)) {
         myNonpFalse_ParentRe (myObjPr);
         myPrintObjArray.push(myObjPr);
        else {
         myArrayNonprintingIm.push(myObjPr.itemLink.name);
       else {myArrayNonprintingIm.push(myObjPr.itemLink.name);}
       if (myNonPrImSeld == true) {myPrintObjArray.push(myObjPr);}
    else myPrintObjArray.push(myObjPr);
    return myPrintObjArray;
    /* Функция возвращает массив изображений, выбранных
    по состоянию связи c файлом из массива myImagesArray, */
    function selMissNormModAll_Links(myImagesArray, LinksStatusIndex, atrNonPrint) {
    if (LinksStatusIndex == 3) {return myImagesArray;}
    var myStatusImages = new Array();
    var myStatusLink;
    for (var myCounter = 0; myCounter < myImagesArray.length; myCounter++) {
      myStatusLink = myImagesArray[myCounter].itemLink.status;
      // отсутствующие
      if (myStatusLink == LinkStatus.linkMissing && LinksStatusIndex == 0)
       {myStatusImages.push(myImagesArray[myCounter]);}
      // нормальные
      if (myStatusLink == LinkStatus.normal && LinksStatusIndex == 1)
       {myStatusImages.push(myImagesArray[myCounter]);}
      // модифицированные
      if (myStatusLink == LinkStatus.linkOutOfDate && LinksStatusIndex == 2)
       {myStatusImages.push(myImagesArray[myCounter]);}
    return myStatusImages;
    /* Функция замещения связей с файлами. Возвращает массив с результатами замещения. */
    function SelectedFiles_Relink (MySeldGraphics, MyRFolder, myExten) {
    var myLink;
    var myNewLinkName = "";
    var myFileName = "";
    var myFileNameNoExt = "";
    var myRelinkFileName = "";
    var RelinkToFilesName = "";
    var myBlendingSettings = "";
    var myUpdLink;
    var RelinkYes = true;
    var ReportAlerts = new Array();
    var mySeccessRelinks = new Array();
    var DuplicatsCancelObj = new Array();
    var NoFileExistErrorLinks = new Array();
    var CancelByURelink = new Array();
    var OldGeomBounds;
    var myCountUndo;
    var myImageRotAng;
    var myImageShAngl;
    var myPossAngleW;
    var myNewFImage;
    var myPrSc;
    var myNewPrSc;
    var myIsImagePar = new Array();
    // считать координаты для разворота
    app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin;
    // установка центральной точки (для поворота изображения)
    app.activeWindow.transformReferencePoint = AnchorPoint.centerAnchor;
    for (var i = 0; i < MySeldGraphics.length; i++) {
      myLink = MySeldGraphics[i][0].itemLink;
      myFileName = myLink.name;
      myFileNameNoExt = FileNameWtExt(myFileName, myButFirstDotName); 
      if (MySeldGraphics[i][1] == true) {   
       if (myExten == nameNCE) {myRelinkFileName = myFileName;}
       else {myRelinkFileName = myFileNameNoExt + "." + myExten;}
       // полное имя файла
       myNewLinkName = MyRFolder + "/" + myRelinkFileName;
       // переменная, описывающая операцию замещения файлов
       RelinkToFilesName = myFileName + local_To + myRelinkFileName;
       // если файл найден
       if (File (myNewLinkName).exists) {
        // запоминаем геометрические координаты предварительного изображения
        OldGeomBounds = MySeldGraphics[i][0].geometricBounds;
        // для пошагового режима
        if (selStepMode) {
         myLink.show();
         // blending settings
         if (selChTransp) {myBlendingSettings = OBJ_Effects(MySeldGraphics[i][0], InDver.substr(0,1));}
         RelinkYes = confirm (local_Relink + " " + RelinkToFilesName + "?\n\n" + myBlendingSettings);
         if (RelinkYes) {
          // запоминаем параметры предварительного изображения
          myIsImagePar = [MySeldGraphics[i][0].horizontalScale, MySeldGraphics[i][0].verticalScale, MySeldGraphics[i][0].shearAngle, MySeldGraphics[i][0].rotationAngle, OldGeomBounds];
          // отношение горизонтального и вертикального масштабов
          myPrSc = ScaleProp_HV(MySeldGraphics[i][0]);
        if (RelinkYes) {
         myLink.relink (File(myNewLinkName));
         myUpdLink = myLink.update();
         myNewFImage = myUpdLink.parent;
         myNewFImage.geometricBounds = OldGeomBounds;
         myCountUndo = 3;
         // для пошагового режима
         if (selStepMode == true) {
          // отключаем путь
          if (selClipPathNone == true) {
           if (myUpdLink.parent.clippingPath.clippingType != ClippingPathType.none) {
            myUpdLink.parent.clippingPath.clippingType = ClippingPathType.none;
            myCountUndo++;
          myUpdLink.show();
          // проверка вращения изображения на 90°
          if (selChRotate == true) {
           beRotate = false;
           // анализ вероятности поворота изображения (±90°)
           myNewPrSc = ScaleProp_HV(myNewFImage);
           if (Math.abs (myNewPrSc - myPrSc ) > myVGScDop) {
            // поворот изображения
            if (InDver.substr(0, 1) < 5) {myCountUndo = myRotateDialogCS2 (myNewFImage, myIsImagePar, myCountUndo);}
            else {myCountUndo = myRotateUIDialog (myNewFImage, myIsImagePar, myCountUndo);}
          // изображение - по центру фрейма
          if (selCenterCont) {
           myNewFImage.fit (FitOptions.centerContent);
           myCountUndo++;
          // углы - 0 градусов
          if (selAngles_0) {
           myCountUndo = image_ZeroAngle (myNewFImage, myCountUndo, beRotate);
          else {myCountUndo = anglesRounding (myNewFImage, myCountUndo);}
          // масштаб - 100 %
          if (selScale_100) {
           myCountUndo = image_VH_Scale_100 (myNewFImage, myCountUndo);
          else {myCountUndo = Scale_VH (myNewFImage, myPrSc, myCountUndo);}
          // применить изменения изображения
          if (confirm (local_ApplyChanges, "", inScriptName) == false) {
           myResUndo (myCountUndo);
           CancelByURelink.push(RelinkToFilesName);
           if (confirm (local_ContinueRelink, "", inScriptName) == false) break;
         else mySeccessRelinks.push(RelinkToFilesName);
        else mySeccessRelinks.push(RelinkToFilesName);
       else CancelByURelink.push(RelinkToFilesName);
      else NoFileExistErrorLinks.push(myRelinkFileName);
    else {if (myExten != nameNCE) {DuplicatsCancelObj.push(myFileNameNoExt);} else {DuplicatsCancelObj.push(myFileName);}}
    } // завершение цикла
    ReportAlerts.push(mySeccessRelinks);
    ReportAlerts.push(NoFileExistErrorLinks);
    ReportAlerts.push(DuplicatsCancelObj);
    ReportAlerts.push(CancelByURelink);
    ReportAlerts.push(MySeldGraphics.length);
    ReportAlerts.push(myExten);
    ReportAlerts.push(MyRFolder);
    return ReportAlerts;
    /* Функция формирует отчет по замещению фйлов изображений документа. */
    function ReportErrorsRelink (ArrErrorsLinks, myFoundSt, DnStPage, DnEndPage, DnNSec, SelSecY, TypeDocSel) {
    // массив сообщений отчета замены связей
    var StLabelsArr = new Array(local_RepInf_1, local_RepInf_2, local_RepInf_3, local_RepInf_4, local_RepInf_5);
    var myReportRelnk = app.dialogs.add({name: local_Report, canCancel: false});
    var myFragmD = myReportRelnk.dialogColumns.add().borderPanels.add().dialogColumns.add();
    with (myFragmD) {
      var myEndRT;
      var myBegRT;
      if (ArrErrorsLinks[5]  == nameNCE) {myEndRT = local_To + ArrErrorsLinks[5] + " " + local_FNames;}
      else {myEndRT = local_To + ArrErrorsLinks[5] + local_Files;} 
      if (myFoundSt != inpVLinkStArr[3][0]) {myBegRT = "1) " + local_LinkStatus + " \"" + myFoundSt + "\"";}
      else {myBegRT = "1) " + myFoundSt;}
      // формируем отчет
      with (dialogRows.add()) {
       dialogColumns.add().staticTexts.add({staticLabel: local_Conditions});
       with (dialogColumns.add()) {
        dialogRows.add().staticTexts.add({staticLabel: myBegRT});
        dialogRows.add().staticTexts.add({staticLabel: "2) " + myStrSymbolsReplace(TypeDocSel, ",", ", ") + myEndRT});
      dialogRows.add().staticTexts.add({staticLabel: local_Found + " " + local_Links + ": " + ArrErrorsLinks[4]});
      for (var myBordersCount = 0; myBordersCount <  StLabelsArr.length; myBordersCount++)
      if (myBordersCount < 4) {
       BorderTextsDropdowns (myFragmD, StLabelsArr[myBordersCount], ArrErrorsLinks[myBordersCount], 230);
      else {
       var mySecSelInfo;
       if (SelSecY) {mySecSelInfo =  local_OfSectionsN + (DnNSec+1);}
       else {mySecSelInfo = local_OfDocument;}
       dialogRows.add().staticTexts.add({staticLabel: PageRangeLabel + " " + DnStPage + " - " + DnEndPage + mySecSelInfo});
       BorderTextsDropdowns (myFragmD, StLabelsArr[myBordersCount], ArrErrorsLinks[7], 230);
      dialogRows.add().staticTexts.add({staticLabel: local_Folder + Folder.decode (Folder(ArrErrorsLinks[6]).name)});
    myReportRelnk.show();
    myReportRelnk.destroy();
    /* Функция формирует панель диалога с текстовой информацией
    и "выпадающим списком" неповторяющихся объектов массива myArray. */
    function BorderTextsDropdowns (myDialogArh, StrTextLabel, myArray, DdownsMinimW) {
    if (myArray.length > 0) {
    with (myDialogArh.borderPanels.add()) {
      staticTexts.add({staticLabel: StrTextLabel + ": " + myArray.length, minWidth: DdownsMinimW});
      try {dropdowns.add({stringList: myArray, selectedIndex: 0, minWidth: 320});}
      catch (e) {alert (e);}
    /* Функция возвращает массив графических объектов заданного диапазона страниц  документа.*/
    function RangePagesGraphics (mySegDoc, StartEC, EndgEC, SNSel, SecStart, SecEnd) {
    var NPageStart = -1;
    var CurrtPage;
    var myGaphicsCounter;
    var MyGraphicsP = new Array();
    var MyGraphicsPFinal = new Array();
    var myLinkType;
    // для диапазона страниц документа
    for (var myPageCounter = SecStart; myPageCounter <  SecEnd; myPageCounter++) {
      CurrtPage = mySegDoc.pages[myPageCounter];
      if (StartEC == CurrtPage.name) {NPageStart = CurrtPage.name;}
      if (NPageStart != -1) {
       // дополняем массив графическими объектами страницы
       for (myGaphicsCounter = 0; myGaphicsCounter <  CurrtPage.allGraphics.length; myGaphicsCounter++) {
        if (CurrtPage.allGraphics[myGaphicsCounter].itemLink != null) {MyGraphicsP.push(CurrtPage.allGraphics[myGaphicsCounter]);}
      // если имя текущей и финальной в диапазоне совпадают, то выходим из цикла
      if (EndgEC == CurrtPage.name)  break;
    EndgEC = CurrtPage.name;
    /* если не найдена первая страница в диапазоне,
    то считаем, что диапазон внутри секции задан неправильно,
    заполняем массив графическими объектами выбранной секции */
    if(SNSel == true & NPageStart == -1) {
      NPageStart = mySegDoc.pages[SecStart].name;
      for(myPageCounter = SecStart; myPageCounter <  SecEnd; myPageCounter++) {
       CurrtPage = mySegDoc.pages[myPageCounter];
       // дополняем массив графическими объектами страницы
       for(myGaphicsCounter = 0; myGaphicsCounter <  CurrtPage.allGraphics.length; myGaphicsCounter++) {
        if (CurrtPage.allGraphics[myGaphicsCounter].itemLink != null) {MyGraphicsP.push(CurrtPage.allGraphics[myGaphicsCounter]);}
      EndgEC = CurrtPage.name;
    MyGraphicsPFinal.push(MyGraphicsP);
    MyGraphicsPFinal.push(NPageStart);
    MyGraphicsPFinal.push(EndgEC);
    return MyGraphicsPFinal;
    /* Функция возвращает массив параметров секций документа.
    ArrFSecPageNumbers [section number][0] - порядковый номер первой страницы секции,
    ArrFSecPageNumbers [section number][1] - "true" - включать префикс секции при нумерации,
    ArrFSecPageNumbers [section number][2] - префикс секции,
    ArrFSecPageNumbers [section number][3] - номер первой страницы секции,
    ArrFSecPageNumbers [section number][4] - количество страниц в секции.*/
    function SecRangeOfPages (myDocument) {
    var mySecEnd = 0;
    var ArrFSecPageNumbers = new Array();
    var SectionOfPage = myDocument.pages[0].appliedSection;
    var SecPrefixName = SectionOfPage.sectionPrefix;
    var SecPnumStart =  SectionOfPage.pageNumberStart;
    var SecIncludePrfx = SectionOfPage.includeSectionPrefix;
    ArrFSecPageNumbers.push([0, SecIncludePrfx, SecPrefixName, SecPnumStart, 0]);
    for (var myPageCounter = 0; myPageCounter <  myDocument.pages.length; myPageCounter++) {
      CurrentSection = myDocument.pages[myPageCounter].appliedSection;
      if (SectionOfPage != CurrentSection) {
       SecPrefixName = CurrentSection.sectionPrefix;
       SecPnumStart =  CurrentSection.pageNumberStart;
       SecIncludePrfx = CurrentSection.includeSectionPrefix;
       ArrFSecPageNumbers[ArrFSecPageNumbers.length-1][4] = mySecEnd;
       mySecEnd = 0;
       ArrFSecPageNumbers.push([myPageCounter, SecIncludePrfx, SecPrefixName, SecPnumStart, mySecEnd]);
       SectionOfPage = CurrentSection;
      mySecEnd++;
    ArrFSecPageNumbers[ArrFSecPageNumbers.length-1][4] = mySecEnd;
    return ArrFSecPageNumbers;
    /* Функция удаления папок и системных файлов из массива объектов выбранной папки.
    Возвращает массив типов файлов (расширений). */
    function ExtenSysCheck (ArrayFilesExt) {
    var GrFilesExtArr = new Array();
    var CurrFile;
    for (var myCr = 0; myCr < ArrayFilesExt.length; myCr++) {
      CurrFile = ArrayFilesExt[myCr];
      // не папка, не системный файл
      if (typeof CurrFile.open != "undefined" && !MacOsXSysFile(CurrFile))
      GrFilesExtArr.push(FileNExt(CurrFile));
    GrFilesExtArr = getUniqObjArray(GrFilesExtArr);
    return GrFilesExtArr;
    /* Функция определения "системного файла" по расширению,
    если имя файла начинается с точки, то определяем его как системный файл (для Mac OS X). */
    function MacOsXSysFile(FileNamePath) {
    var myFileNamePath = String(FileNamePath);
    var EndFullPath = myFileNamePath.lastIndexOf("/");
    var myFileFirstT = myFileNamePath.substr(EndFullPath+1, 1);
    if (myFileFirstT == ".") {return true;}
    var ExtCurrFile = FileNExt (myFileNamePath);
    if(ExtCurrFile.length > 2 && ExtCurrFile.length < 5) {
      var SysExtArr = new Array ("DAT","VOL","APP","INI","SYS","COM","BAT","BAK", "ATM","TMP","DLL","REG","OLD","LOG","CFG","JSX","OTF","PFB","PFM","TTF","FON","LNK","EXE" );
      for (var extCr = 0; extCr < SysExtArr.length; extCr++) {
       if (ExtCurrFile == SysExtArr[extCr] || ExtCurrFile == SysExtArr[extCr].toLowerCase()) return true;}
    else return true;
    return false;
    /* Функция проверки дубликатов имен файлов
    (с расширением - при замене на идентичный тип или без расширения).
    Возвращает массив графических объектов с "разрешением замены" - ArrayGraphObjReLinksSt.
    Игнорируются файлы с дублирующимися именами:
    с расширением - при замене на тип файлов "идентичный",
    без расширения - при замене на выбранный тип, при отличающихся полных именах файлов. */
    function FindDuplicatesNames (ArrayGraphObj, myextSel, DotFirst) {
    var NameNoExt = "";
    var NameNoExtArr = new Array();
    var ArrayGraphObjReLinksSt = new Array();
    var IndFD = new Array();
    // заполняем массив имен файлов
    for (var myCr = 0; myCr < ArrayGraphObj.length; myCr++) {
      if (myextSel != nameNCE) {NameNoExt = FileNameWtExt (ArrayGraphObj[myCr].itemLink.name, DotFirst);}
      else {NameNoExt = ArrayGraphObj[myCr].itemLink.name;}
      NameNoExtArr.push (NameNoExt);
    for (myCr = 0; myCr < ArrayGraphObj.length; myCr++) {
      var PathExtArr = new Array();
      IndFD = checkDoubled (NameNoExtArr, NameNoExtArr[myCr]);
      if (IndFD.length > 1){
        for (var myDuplidx = 0; myDuplidx < IndFD.length; myDuplidx++) {PathExtArr.push(ArrayGraphObj[IndFD[myDuplidx]].itemLink.filePath);}   
        if (getUniqObjArray(PathExtArr).length == 1) {ArrayGraphObjReLinksSt.push([ArrayGraphObj[myCr], true]);}
        else {ArrayGraphObjReLinksSt.push([ArrayGraphObj[myCr], false]);}
      else {ArrayGraphObjReLinksSt.push([ArrayGraphObj[myCr], true]);}
    return ArrayGraphObjReLinksSt;
    /* Функция определения расширения файла, возвращает часть строки от крайней правой точки. */
    function FileNExt (FileNamePath) {
    var myFileNamePath = String (FileNamePath);
    var myFileNEnd = myFileNamePath.lastIndexOf (".");
    if (myFileNEnd != -1) {myFileNamePath = myFileNamePath.substr(myFileNEnd+1);}
    return myFileNamePath;
    /* Функция удаляет расширение файла,
    возвращает строку от начала myFileName до первого (при myDotOrd = true)
    или последнего символа точки (myDotOrd = false). */
    function FileNameWtExt (myFileName, myDotOrd) {
    var myFileNamePath = String (myFileName);
    var myFileNEnd = myFileNamePath.lastIndexOf (".");
    if (myFileNEnd != -1) {
      myFileNamePath = myFileName.substr (0, myFileNEnd);
      if (myDotOrd) {
       // рекурсивный вызов функции
       myFileNamePath = FileNameWtExt (myFileNamePath, true);
    return myFileNamePath;
    /* Функция получения массива типов графических файлов, которые используются в документе (ActDoc).
    Выполняется Unlock Position для всех объектов и групп с графическими изображениями документа.
    Определяется количество изображений, которые были вставлены в документ из буфера обмена (Null Link). */
    function GetFileTypeInDoc (ActDoc) {
    var myObject;
    var myImageType;
    var myDocTypeArr = new Array();
    var myDocUniqTypeArr;
    var myResultDocTypeAndCounters = new Array();
    for (var myCr = 0; myCr < ActDoc.allGraphics.length; myCr++) {
      myObject = ActDoc.allGraphics[myCr];
      myUnlock_ParentRe (myObject);
      try {
       myImageType = myObject.itemLink.linkType;
       myDocTypeArr.push(myImageType);
      catch (e) {
       mySelection_ParentRe(myObject, myObject);
       if (!confirm(alertWithoutLink, "", inScriptName)) {exit();}
    myDocUniqTypeArr = getUniqObjArray(myDocTypeArr);
    for (myCr = 0; myCr < myDocUniqTypeArr.length; myCr++) {
      myResultDocTypeAndCounters.push([myDocUniqTypeArr[myCr], checkDoubled(myDocTypeArr, myDocUniqTypeArr[myCr]).length]);
    return myResultDocTypeAndCounters;
    /* Функция осуществляет переход в активном окне на разворот
    с объектом myGraphObj и выделяет mySelectObj, если обект не является содержимым текстового блока. */
    function mySelection_ParentRe (myGraphObj, mySelectObj) {
    app.activeDocument.select (mySelectObj);
    app.activeWindow.zoom (2053206906);
    if (myGraphObj.parent.constructor.name != "Story") {
      try {app.activeWindow.activeSpread = myGraphObj.parent;}
      // рекурсивный вызов при ошибке
      catch (e) {mySelection_ParentRe(myGraphObj.parent, mySelectObj);}
    // Функция выполняет UnLock Positon изображения myGraphObj
    function myUnlock_ParentRe (myGraphObj) {
    try {myGraphObj.parent.locked = false;}
    // рекурсивный вызов при ошибке
    catch (e) {myUnlock_ParentRe(myGraphObj.parent);}
    /* Функция выполняет поиск "истинности" атрибута Nonprinting для изображения и групп, включающих текущий объект. */
    function myNonprint_ParentRe (myGraphNObj) {
    try {
      var mNonPrRes = myGraphNObj.nonprinting;
      // условие рекурсивного вызова функции
      if (mNonPrRes == false) {
       mNonPrRes = myNonprint_ParentRe (myGraphNObj.parent);
       if (mNonPrRes) {return true;}
      else {return true;}
    catch (e) {return false;}
    /* Функция отменяет "истинность" атрибута Nonprinting
    для изображения, его контейнера и групп, включающих текущий объект. */
    function myNonpFalse_ParentRe (myGraphFObj) {
    try {
      myGraphFObj.nonprinting = false;
      myNonpFalse_ParentRe(myGraphFObj.parent);
    catch (e) {}
    /* Функция поиска дубликата myObject в массиве myArray. Возвращает массив индексов найденных дубликатов в массиве. */
    function checkDoubled(myArray, myObject) {
    var IndxDupls = new Array();
    for (var objCnr = 0; objCnr < myArray.length; objCnr++) {
      if (myObject == myArray[objCnr]) {IndxDupls.push(objCnr);}
    return IndxDupls;
    /* Функция возвращает массив myResultArr из неповторяющихся объектов массива myArray. */
    function getUniqObjArray (myArray) {
    var myResultArr = new Array();
    var myObject;
    for (var myCounter = 0; myCounter < myArray.length; myCounter++) {
      myObject = myArray[myCounter];
      if (checkDoubled(myResultArr, myObject).length == 0) {myResultArr.push(myObject);}
    return myResultArr;
    function cr() {if (mn != "\u00A9\ \u0044\u006D\u0069\u0074\u0072\u0069\u0079\ \u004C\u0061\u0070\u0061\u0079\u0065\u0076") exit();}
    /* Функция получения графических объектов выбранных типов (ArrTypeFind) из массива (myRastrImageArray). */
    function getTypeRastrImages (myRastrImageArray, ArrTypeFind) {
    var myTypeResult = new Array();
    var myObject;
    var myTypeImage;
    for (var myCounter = 0; myCounter < myRastrImageArray.length; myCounter++) {
      myObject = myRastrImageArray[myCounter];
      myTypeImage = myObject.itemLink.linkType;
      for (var TypeCr = 0; TypeCr < ArrTypeFind.length; TypeCr++) {
       if (myTypeImage == ArrTypeFind[TypeCr][1] && ArrTypeFind[TypeCr][0] == true) {
        myTypeResult.push(myObject);
    return myTypeResult;
    /* Функция поворота изображения myRImage на 90° по часовой стрелке или против,
    в диалоге выбирается направление вращения. После вращения:
    изображению присваиваются значения geometricBounds исходного,
    возвращается счетчик действий над изображением - myCountNone.
    myImageArrPars  (horizontalScale, verticalScale, shearAngle, rotationAngle, geometricBounds). */
    function myRotateUIDialog (myRImage, myImageArrPars, myCountNone) {
    // Прогнозирование возможного поворота изо

    Check out my Update path names in links script: http://www.kasyan.ho.com.ua/relink.html
    Kasyan

  • Printing only certain colors to Postscript [JS, CS3]

    Is there a way, via a script, to only output certain ink colors when printing to a Postscript file? When doing it manually you can choose which colors to output, but I haven't been able to find any way to do that through a script. Any ideas?

    Well I believe I have this working now. Here's the code:
    // This script works by doing a few things. First, it will delete any ink that isn't actually on the document and in use.
    // Then it will prompt the user to choose what inks they want to output. Once the script has those ink choices,
    // it will decide, via four if statements, what colors to output. There are four if statements to handle all the combinations
    // of cyan and black outputs. The other colors checked (red, blue, etc.) will be printed from within all the ifs.
    // Once it knows what colors to output it creates a preset based on those criteria, and then uses that preset to
    // output the file. After the file is printed to Postscript it deletes the preset and saves and closes the file.
    // If the preset doesn't get deleted for some reason, it will simply be overwritten the next time the script runs.
    // I figured it would be cleaner if it would delete it each time.
    if (app.documents.length == 0)
    alert("No document is open.")
    exit();
    var myDocument = app.activeDocument;
    v =myDocument.unusedSwatches.length-1;
    while (v >= 0)
      try {
       myDocument.unusedSwatches[v].remove();
      } catch (_) { }
      v--;
    inklist = myDocument.inks.everyItem().name;
    checklist = [];
    //creates dialog box
    var inkDialog = app.dialogs.add({name:"F4 2up LH", canCancel:true});
    with (inkDialog.dialogColumns.add())
            with(dialogRows.add())
                var choiceText = staticTexts.add({staticLabel:"Choose ink(s) to output:"});   
            with(dialogRows.add())
                with(dialogColumns.add())
                    for (i=0; i<inklist.length; i++)
                    with(dialogRows.add())
                    //.push adds items to an array
                    checklist.push(checkboxControls.add({staticLabel:inklist[i], checkedState:false}));
    //Display the dialog box
    var myDialog = inkDialog.show();
    if(myDialog == true)
        for (m=0; m<checklist.length; m++)
            if(checklist[m].checkedState == true)
                myDocument.inks[m].printInk = true;
            else
                myDocument.inks[m].printInk = false;
    else
        inkDialog.destroy();
        exit();
    //check to see if cyan is checked and black is not
    if((checklist[0].checkedState == true) && (checklist[3].checkedState == false))
        var myPreset = app.printerPresets.item("tempPreset");
    try
        myPreset.name;
    catch(myError)
        myPreset = app.printerPresets.add({name:"tempPreset"});
    with(app.activeDocument.printPreferences)
        pageRange = PageRange.allPages;
        myPreset.useDocumentBleedToPrint = useDocumentBleedToPrint;
        myPreset.printer = Printer.POSTSCRIPT_FILE;
        myPreset.ppd = "PlateStream";
        myPreset.colorOutput = ColorOutputModes.SEPARATIONS;   
        myPreset.paperSize = PaperSizes.custom;   
        myPreset.pagePosition = PagePositions.UPPER_LEFT;
        //myPreset.screening = ("110 lpi / 1200 dpi");
        myPreset.cyanFrequency = 110;   
        myPreset.cyanAngle = 15;
        myPreset.printCyan = true;
        myPreset.magentaFrequency = 70;
        myPreset.magentaAngle = 15;   
        myPreset.printMagenta = false;
        myPreset.yellowFrequency = 70;   
        myPreset.yellowAngle = 0;
        myPreset.printYellow = false;
        myPreset.blackFrequency = 70;   
        myPreset.blackAngle = 45;
        myPreset.printBlack = false;
        mydpp = myDocument.printPreferences;
        mydpp.activePrinterPreset = "tempPreset";
        f = new File("//172.25.77.225/spool/"+ myDocument.name +".ps");
        mydpp.printFile = f;
        myDocument.print(false, undefined);
        myPreset.remove();
        myDocument.save();
        myDocument.close();
    //check to see if cyan is unchecked, but black is checked
    if((checklist[0].checkedState == false) && (checklist[3].checkedState == true))
        var myPreset = app.printerPresets.item("tempPreset");
    try
        myPreset.name;
    catch(myError)
        myPreset = app.printerPresets.add({name:"tempPreset"});
    with(app.activeDocument.printPreferences)
        pageRange = PageRange.allPages;
        myPreset.useDocumentBleedToPrint = useDocumentBleedToPrint;
        myPreset.printer = Printer.POSTSCRIPT_FILE;
        myPreset.ppd = "PlateStream";
        myPreset.colorOutput = ColorOutputModes.SEPARATIONS;
        myPreset.paperSize = PaperSizes.custom;
        myPreset.pagePosition = PagePositions.UPPER_LEFT;
        //myPreset.screening = ("110 lpi / 1200 dpi");
        myPreset.cyanFrequency = 110;
        myPreset.cyanAngle = 15;
        myPreset.printCyan = false;
        myPreset.magentaFrequency = 70;
        myPreset.magentaAngle = 15;
        myPreset.printMagenta = false;
        myPreset.yellowFrequency = 70;   
        myPreset.yellowAngle = 0;
        myPreset.printYellow = false;
        myPreset.blackFrequency = 70;   
        myPreset.blackAngle = 45;
        myPreset.printBlack = true;
        mydpp = myDocument.printPreferences;
        mydpp.activePrinterPreset = "tempPreset";
        f = new File("//172.25.77.225/spool/"+ myDocument.name +".ps");
        mydpp.printFile = f;
        myDocument.print(false, undefined);
        myPreset.remove();
        myDocument.save();
        myDocument.close();
    //check to see if black AND cyan are checked
    if((checklist[3].checkedState == true) && (checklist[0].checkedState == true))
        var myPreset = app.printerPresets.item("tempPreset");
    try
        myPreset.name;
    catch(myError)
        myPreset = app.printerPresets.add({name:"tempPreset"});
    with(app.activeDocument.printPreferences)
        pageRange = PageRange.allPages;
        myPreset.useDocumentBleedToPrint = useDocumentBleedToPrint;
        myPreset.printer = Printer.POSTSCRIPT_FILE;
        myPreset.ppd = "PlateStream";
        myPreset.colorOutput = ColorOutputModes.SEPARATIONS;
        myPreset.paperSize = PaperSizes.custom;   
        myPreset.pagePosition = PagePositions.UPPER_LEFT;
        //myPreset.screening = ("110 lpi / 1200 dpi");
        myPreset.cyanFrequency = 110;
        myPreset.cyanAngle = 15;
        myPreset.printCyan = true;
        myPreset.magentaFrequency = 70;
        myPreset.magentaAngle = 15;   
        myPreset.printMagenta = false;
        myPreset.yellowFrequency = 70;   
        myPreset.yellowAngle = 0;
        myPreset.printYellow = false;
        myPreset.blackFrequency = 70;   
        myPreset.blackAngle = 45;
        myPreset.printBlack = true;
        mydpp = myDocument.printPreferences;
        mydpp.activePrinterPreset = "tempPreset";
        f = new File("//172.25.77.225/spool/"+ myDocument.name +".ps");
        mydpp.printFile = f;
        myDocument.print(false, undefined);
        myPreset.remove();
        myDocument.save();
        myDocument.close();
    //otherwise, neither cyan nor black are checked
    else
        if((checklist[3].checkedState == false) && (checklist[0].checkedState == false))
            var myPreset = app.printerPresets.item("tempPreset");
    try
        myPreset.name;
    catch(myError)
        myPreset = app.printerPresets.add({name:"tempPreset"});
    with(app.activeDocument.printPreferences)
        pageRange = PageRange.allPages;
        myPreset.useDocumentBleedToPrint = useDocumentBleedToPrint;
        myPreset.printer = Printer.POSTSCRIPT_FILE;
        myPreset.ppd = "PlateStream";
        myPreset.colorOutput = ColorOutputModes.SEPARATIONS;
        myPreset.paperSize = PaperSizes.custom;   
        myPreset.pagePosition = PagePositions.UPPER_LEFT;
        //myPreset.screening = ("110 lpi / 1200 dpi");
        myPreset.cyanFrequency = 110;
        myPreset.cyanAngle = 15;   
        myPreset.printCyan = false;
        myPreset.magentaFrequency = 70;
        myPreset.magentaAngle = 15;
        myPreset.printMagenta = false;
        myPreset.yellowFrequency = 70;   
        myPreset.yellowAngle = 0;
        myPreset.printYellow = false;
        myPreset.blackFrequency = 70;   
        myPreset.blackAngle = 45;
        myPreset.printBlack = false;
        mydpp = myDocument.printPreferences;
        mydpp.activePrinterPreset = "tempPreset";
        f = new File("//172.25.77.225/spool/"+ myDocument.name +".ps");
        mydpp.printFile = f;
        myDocument.print(false, undefined);
        myPreset.remove();
        myDocument.save();
        myDocument.close();
    inkDialog.destroy();
    So far it's been working quite nicely. Thanks for all the help everyone. If there is anything that looks like it should be changed please let me know. It's been a while since I did anything like this.
    Nate

  • New CS4 features

    At Dave's suggestion, I'm starting a thread for discussing new scripting
    features is CS4. I'd divide new features into three categories: 1)
    improvements/additions to the InDesign DOM, 2) improvements to the ESTK,
    and 3) improvements/additions to ScriptUI.
    I'll start off this thread with one improvement on each of these fronts.
    (There are lots...)
    Category 1:
    There's a new isValid property for all InDesign objects. This is
    something that's been in the SDK for ever, but only made its way into
    the scripting DOM of CS4. This means that instead of try/catch every
    time you're trying to figure out if an object is valid, you can just write:
    if(myObject.isValid){DoMyStuff()}
    or,
    if(! myObject.isValid){return}
    This is a small thing but in my book it's huge!
    Category 2:
    There's a new function panel in the ESTK which shows all the functions
    in the current script and makes navigating to the functions very easy.
    Category 3:
    There are now keyboard and mouse events, so you can now create widgets
    which do everything the built in dialog scripting widgets do (and a
    whole lot more!!!)
    Harbs
    http://www.in-tools.com

    Noel, nothing wrong with Roy's posts for me (using the default web interface). It may just be you :-)
    Talking about interfaces, please don't comment on this one. It does the job, innit? (I'm sure someone else could do better with ScriptUI. Go ahead.)
    var myStyleList = new Array;
    for(c = 1; c < app.activeDocument.paragraphStyles.length; c++)
    if (app.activeDocument.paragraphStyles.item(c).otfStylisticAlternate == true)
      name = "[+] ";
    else
      name = "[-] ";
    name += app.activeDocument.paragraphStyles.item(c).name;
    myStyleList.push(name);
    var myCharsList = new Array;
    for(c = 1; c < app.activeDocument.characterStyles.length; c++)
    if (app.activeDocument.characterStyles.item(c).otfStylisticAlternate == true)
      name = "[+] ";
    else
      name = "[-] ";
    name += app.activeDocument.characterStyles.item(c).name;
    myCharsList.push (name);
    var parDialog = app.dialogs.add({name:"Salt your Styles",canCancel:true});
    with(parDialog)
    with(dialogColumns.add())
      with(dialogRows.add())
       parCheck = checkboxControls.add({staticLabel:"Paragraph style"});
       parDropdown = dropdowns.add({stringList:myStyleList, selectedIndex:0});
      with(dialogRows.add())
       charCheck = checkboxControls.add({staticLabel:"Character style"});
       charDropdown = dropdowns.add({stringList:myCharsList, selectedIndex:0});
    var result = parDialog.show();
    if (result)
      if (parCheck.checkedState)
       app.activeDocument.paragraphStyles.item(parDropdown.selectedIndex+1).otfStylisticAlternate =
        !app.activeDocument.paragraphStyles.item(parDropdown.selectedIndex+1).otfStylisticAlternate;
      if (charCheck.checkedState)
       app.activeDocument.characterStyles.item(charDropdown.selectedIndex+1).otfStylisticAlternate =
        !app.activeDocument.characterStyles.item(charDropdown.selectedIndex+1).otfStylisticAlternate;
    parDialog.destroy();

  • How to let a button of class ButtonBar Down?

    is it possible to let a button of class BUTTONBAR Down and
    if 'YES' how to do?
    null

    David,
    I Included a sample from the JDeveloper Help how to add a
    buttonbar to your application and how to add buttons to it
    hope this helps
    Federico
    package buttonbarsample;
    import java.awt.*;
    import java.awt.event.*;
    import borland.jbcl.control.*;
    import borland.jbcl.layout.*;
    public class Frame1 extends DecoratedFrame {
    BorderLayout borderLayout1 = new BorderLayout();
    XYLayout xYLayout2 = new XYLayout();
    BevelPanel bevelPanel1 = new BevelPanel();
    ButtonBar buttonBar = new ButtonBar();
    StatusBar statusBar = new StatusBar();
    CheckboxControl checkboxControl1 = new CheckboxControl();
    ButtonControl buttonControl1 = new ButtonControl();
    //Construct the frame
    public Frame1() {
    try {
    jbInit();
    catch (Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception{
    this.setLayout(borderLayout1);
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    buttonBar.setBevelOuter(BevelPanel.LOWERED);
    buttonBar.setBevelInner(BevelPanel.LOWERED);
    buttonBar.setButtonOrientation
    (borland.jbcl.util.Orientation.VERTICAL);
    buttonBar.setButtonType(ButtonBar.IMAGE_ONLY);
    buttonBar.setHgap(3);
    buttonBar.setLabels(new String[]
    {"File", "Close", "Help", "Disable", "Toggler"});
    buttonBar.setVgap(2);
    buttonBar.addActionListener(new
    Frame1_buttonBar_actionAdapter(this));
    checkboxControl1.setLabel("Toggle");
    buttonControl1.setLabel("Disabler");
    buttonControl1.addActionListener(new
    Frame1_buttonControl1_actionAdapter(this));
    buttonBar.setImageBase("image");
    buttonBar.setImageNames(new String[]
    {"openFile.gif", "closeFile.gif", "help.gif"});
    buttonBar.setButtonEnabled(3, false);
    bevelPanel1.setLayout(xYLayout2);
    this.add(buttonBar, BorderLayout.NORTH);
    this.add(statusBar, BorderLayout.SOUTH);
    this.add(bevelPanel1, BorderLayout.CENTER);
    bevelPanel1.add(checkboxControl1, new XYConstraints(284, 77,
    83, 38));
    bevelPanel1.add(buttonControl1, new XYConstraints(22, 91, -
    1, -1));
    //File | Exit action performed
    public void fileExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    //Help | About action performed
    public void helpAbout_actionPerformed(ActionEvent e) {
    void buttonControl1_actionPerformed(ActionEvent e) {
    buttonBar.setButtonEnabled(0, !buttonBar.isButtonEnabled(0));
    buttonBar.setButtonEnabled(3, !buttonBar.isButtonEnabled(3));
    void buttonBar_actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("Toggler"))
    checkboxControl1.setChecked(!checkboxControl1.isChecked());
    class Frame1_buttonControl1_actionAdapter implements
    java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_buttonControl1_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.buttonControl1_actionPerformed(e);
    class Frame1_buttonBar_actionAdapter implements
    java.awt.event.ActionListener {
    Frame1 adaptee;
    Frame1_buttonBar_actionAdapter(Frame1 adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.buttonBar_actionPerformed(e);
    David DUPONT (guest) wrote:
    : is it possible to let a button of class BUTTONBAR Down and
    : if 'YES' how to do?
    null

Maybe you are looking for