AppleScript to check all pages within one Indesign (CS6) document have same size.

I have bunch of InDesign (CS6) documents containing different page sizes (some are designed for a particular device and some are designed for multiple devices using alternate layouts). I need to assure all page sizes are same before I run a particular script.
So I need a Applescript which can request a folder location of closed files and then open and run through the InDesigns in that folder (ignoring any other files) and then open a text file report saying all page sizes are same or not. (Sorry! for my English)
Any help is much appreciated!

sure,
still no error-handling included, so use on own risk ;-) ...
#target Indesign
var selFolder = Folder.selectDialog();
if(!selFolder) {exit();};
var allFiles = selFolder.getFiles('*.*');
var currDate = getDate();
var currLogFile = File(selFolder.toString() + '/' + currDate + 'pagesSizeLogFile.txt');
doStuff(allFiles);
currLogFile.execute();
function doStuff(filesFoldersArray){
var l = filesFoldersArray.length;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
while(l--)
  var   currItem = filesFoldersArray[l];
if(currItem instanceof(Folder)){
    nextItems = currItem.getFiles('*.*');
    doStuff(nextItems);
    else if (    currItem.displayName.indexOf('indd') != -1){
    currDoc = app.open(currItem, false);
allPagesBounds = currDoc.pages.everyItem().bounds;
currDocPagesWidthHeight = [currDoc.fullName.toString() + ':\n'];
for(var b = 0; b < allPagesBounds.length; b++) {
    h = allPagesBounds[b][2];
    w = allPagesBounds[b][3] - allPagesBounds[b][1];
    resString = '' + currDoc.pages[b].name + ': ' + w + ' x ' + h + '\n';
    currDocPagesWidthHeight.push(resString)
    var samePageSizesOrNot = checkUnique(currDocPagesWidthHeight);
    switch(samePageSizesOrNot)
        case false :
toFile(currDocPagesWidthHeight.join(''));
currDoc.close(SaveOptions.NO);
break;
default : currDoc.close(SaveOptions.NO); break; }
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
function toFile(pwh)
        currLogFile.open('a');
    currLogFile.write(pwh);
    currLogFile.close()
function checkUnique(someArray) {
           var tmpArray = []  ; 
    var tmpString = '';
         for (var i = 1; i < someArray.length; i++) {
             currItem = someArray[i];
             if (tmpString.indexOf(currItem.slice(2,-1)) === -1){
                tmpString = tmpString + ' ' + currItem;
                                     tmpArray.push(currItem); 
    if (tmpArray.length === 1)
        return true;
        }else{
            return false;}
        function getDate(){
    var d = new Date();
var day = d.getDate();
if(day < 10){day = '0' + day;};
var month = d.getMonth() +1;
if(month < 10){month = '0' + month;};
var year = '' + d.getFullYear();
var hours = d.getHours();
var minutes = d.getMinutes();
var seconds = d.getSeconds();
var dateString = month + day  + year.substring(2) + '_'  + hours + minutes + seconds + '_';
return dateString;

Similar Messages

  • Move group of pages from one InDesign file to another InDesign File using VB.Script

    Dear team,
    I am trying to move group of InDesign pages from one indesign file to another indesign file using vb.script.
    I have written the code like
    Dim Pages=IndDoc.Pages
    Dim Mytype=TypeName(Pages)
    Pages.Move(InDesign.idLocationOptions.idBefore,IndDoc1.Pages.LastItem)
    but it is giving an error as method Move is not a member of Pages 
    please give mme the solution to move the Multiple pages or a group of page from one Indd to another Indd.

    Hey Peter, if I wan to move several page that part of Auto Flow text, I checked the "delete page after moving" but the content still there, not deleted.
    Is there any way to delete it automatically, just to make sure I have moved that autoflowed page?

  • Smartform All pages in one print preview problem

    Hi
         I am displaying the employee data in ALV with checkbox selection.. i put two user defined buttons like print and print preview. when user clicks on print button, smartform will call for very employee in loop and print it employee wise. But my problem is when user clicks on print preview by selecting multiple checkboxes , I need all pages(employee wise like page1,2,3..) in one print preview. I done but for every employee,i have to press the BACK button. But I need all pages in one preview. I'm pasting my code here. Can anyone suggest??
    WHEN 'PREVIEW'.
    w_cparam-no_dialog = 'X'.
      w_cparam-preview = 'X'.
       w_cparam-getotf = ' '.
       w_outoptions-tddest = 'LOCL'.
       w_outoptions-tdnoprev  = ' '.
        w_outoptions-tdimmed  = 'X'.
    * to reflect the data changed into internal table
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    loop at i_data into wa_data where SEL = 'X'.
    MOVE-CORRESPONDING WA_DATA TO WA_PRINT.
      APPEND WA_PRINT TO I_PRINT.
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            FORMNAME                 = 'ZHRF1_PTAR1001'
    *       VARIANT                  = ' '
    *       DIRECT_CALL              = ' '
         IMPORTING
           FM_NAME                  = FM_NAME
    *     EXCEPTIONS
    *       NO_FORM                  = 1
    *       NO_FUNCTION_MODULE       = 2
    *       OTHERS                   = 3
        IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      CALL FUNCTION FM_NAME
        EXPORTING
    *     ARCHIVE_INDEX              =
    *     ARCHIVE_INDEX_TAB          =
    *     ARCHIVE_PARAMETERS         =
         CONTROL_PARAMETERS         = W_CPARAM
    *     MAIL_APPL_OBJ              =
    *     MAIL_RECIPIENT             =
    *     MAIL_SENDER                =
         OUTPUT_OPTIONS             = W_OUTOPTIONS
         USER_SETTINGS              = 'X'
          FR_DATE                    = PN-BEGDA
          TO_DATE                    = PN-ENDDA
       IMPORTING
    *     DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            = T_OTF_FROM_FM
    *     JOB_OUTPUT_OPTIONS         =
        TABLES
          ITAB                       = I_PRINT
    *   EXCEPTIONS
    *     FORMATTING_ERROR           = 1
    *     INTERNAL_ERROR             = 2
    *     SEND_ERROR                 = 3
    *     USER_CANCELED              = 4
    *     OTHERS                     = 5
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CLEAR: WA_DATA,WA_PRINT.
    CLEAR: I_PRINT.
      ENDLOOP.

    Hi friend sure.
    You need to increment the index only at the loop no where else and the variable for holding the index value is global.
    If you create before the read every time it gets trigerred.
    After each loop you assign the sy-tabix value to that variable.
    Just like this ,
    v_index = sy-tabix.
    Then at the window just read the table as shown
    READ TABLE t_chq INTO x_chq INDEX v_index.
    This will do friend.
    I will update the flow of my code here, then you many understand it much clear.
    Page1
      Main window (below page1)
        Loop (inside Main win)
          program lines. code : v_index = sy-tabix. v_lines =  lines( t_chq ). (inside loop)
          Condition (inside loop)
             True
                check the v_index < v_lines if true break page, for page break create a command and do it (Inside true condition)
             false
               blank.
      Secondary window (below page1)
        program line (inside sec wind)
        Inside program lines the code is READ TABLE t_chq INTO x_chq INDEX v_index. (inside sec wind)
      Secondary window2  (below page1)
         program line (inside sec wind2)
        Inside program lines some other code. (inside sec wind2)
    This is my logic try like this friend.
    I think for other records its coming fine because since it is an local variable its getting updated some where and also showing 1 bec its always initializing.
    Try this you will get if any issues please revert back to me
    Thanks,
    Sri Hari
    Edited by: srihari.kumar on Jan 6, 2012 11:04 AM
    Edited by: srihari.kumar on Jan 6, 2012 11:05 AM

  • Is it possible to see all pages in one document at once?

    Hey.
    So I can't figure out if it's possible to see all pages in one document at once, so that it's all on screen at the same time.
    Is it possible and if it is then how so?
    Thanks in advance for any kind of help

    Wouldn't that depend on how many pages there are, how large your screen is and how small you were willing to put up with in the thumbnails?
    Peter

  • How to copying all pages at one shot?

    Does anybody know of a way of copying all pages at one shot, under a tabset in an application in a workspace to another application in the same workspace instead of doing it page by page?

    There is no Select All option, but you can do it a little faster than opening each email and tapping the Trash icon. In the top rightcorner of the list of email is an edit button. Tap Edit.
    You can then tap each email in the list to select it for deleting and then tap the Delete button at the bottom of the list.
    These screenshots are from my iPad, but it works the same on my iPhone.

  • I am now unable to print pdf documents. The message on screen says I have not selected any pages to print, even though the bullet point saying 'All' pages  has been clicked. I have recently upgraded to adobe reader XI, could that be the problem? I also ca

    I am now unable to print pdf documents. The message on screen says I have not selected any pages to print, even though the bullet point saying 'All' pages  has been clicked. I have recently upgraded to adobe reader XI, could that be the problem? I also cannot sign in to Adobe Export pdf now either. It says 'error occured while signing in'!

    Open Adobe Reader | Edit | Preferences | Documents: change View Documents in PDF/A Mode to Never.
    Regarding the ExportPDF problem, please start a new topic in the ExportPDF forum.

  • How do I downsave InDesign CS6 documents to InDesign CS5?

    Is there a way to downsave my InDesign CS6 documents to be opened up by someone who is on InDesign CS5?

    So is the best option to save it to pdf??
    That depends on what you want.
    Want to send it to a print shop? Want to send it to someone who is going to provide editorial commentary? Want to send it to someone who is going to actually edit text? The best option is not obvious to a forum full of random strangers if we don't know your selection criteria. If, from your original post, you need your document
    to be opened up by someone who is on InDesign CS5?
    then PDF by itself may the worst option. I'd suggest that you File -> Package your CS6 file, make sure all linked files are included, and give them an IDML file. And, because the IDML file won't match your CS6 INDD perfectly if you've used any tools new in CS6, give 'em a PDF too. So maybe the best option is "all of the above."

  • Is it possible to give each page within one pdf document a specific set of print settings?

    I have a complex document (catalogue) that requires printing. There are several different printer settings required and each one is specific to each page within the document. For instance pg 1 is single sided in colour, page 2-3 is duplexed in b&w, page 3-8 is duplexed in colour, etc.... Is it possible to give each page within the pdf document a given set of print settings and then print the entire document as a whole?

    Hi jennyskop
    I assume that is not feasible ...You need to give the print command again and select the respective pages and their settings !

  • Spell Check All Pages in Dreamweaver CS4

    With a new converted web site of over 150 pages I need to spell check the pages.
    Is there any extension or method to spell check all of the pages at once?
    Thanks

    Unfortunately, you can’t do it.  As I have noted before, Adobe should be ashamed of itself that I have to import my entire site into FrontPage 98 in order to get an effective spell-check.  I get laughed at for using FrontPage, but it's a far better program, sadly.

  • Copying a page from one InDesign document to another

    I have a page in an InDesign document (which contains graphics) that I would like to copy to another InDesign document, but Copy / Past does not work.

    Have both files open...
    In the source file open the pages panel and select the page(s) you want to copy, from the panel menu choose move page(s), and select the destination file and specify a position.

  • How to maintain a role who can check all SC belong one company.

    hi experts
       we use SRM7.0 standalone scenario.
       there are many plant and each plant has supervisors who need to check all SC belong to themselves plant.
       my solution is assign authoriztion that can use 'SC monitor' in PFCG Role ,and restrict  'Organization level' = plant.. in PFCG .
      now they can check  every plants' SC .
      how to fix it?
        thank in advanced.
          claud

    Hi,
    What do you mean by "need to check all SC belong to themselves plant"?
    Thanks and Regards,
    Abraham

  • Can I use CreatePDF to switch around the pages within a single pdf document that scanned wrong?

    I understand CreatePDF would allow me to combine documents into a single pdf file.  But, (1) can I move around (switch/correct the order of) pages within a single PDF file?  (2) Can I delete pages from a single file or a combined file?  (3) Once created, can I edit the file in any way?  If these services were available, I would likely subscribe.  I don't want to subscribe without knowing.

    Thanks for your reply.  Pardon my ignorance. Acrobat would allow me to move pages around? 
    Michele Haft Hudson, Esq.
    954-655-7020
    [email protected]
    This message was sent from my phone to expedite its delivery to you. Please excuse my brevity and any typographical errors. The content of this message is confidential and may be legally privileged. If you receive it in error, please notify me and delete it.  

  • How Do I Mass Search and Replace Swatch Colors In Entire Indesign CS6 Document?

    I've jumped from CS4 to CS6 and its been a little while since, but just trying to refamiliarize myself with the many Features of Indesign CS6.
    Here's my issue: I have a really old CS4 document I've opened up and saved in CS6. I have to change all swatch colors throughout the document from pantone swatch 295 C to updated pantone swatch 293 C.
    Question, without my having to go through the entire document one object at a time looking for each object, HOW do i perform a Mass search and replace of Color swatch references from 295 C to 293C.
    I thought i could just click swatch properties and update the color... but No... that doesnt work as swatch properties is just grayed out
    I'm sure i've overlooked something but a refresher on how to mass find and replace color in a document would be great.
    Thanks and looking forward to hearing from someone.

    Thanks for the tips.... both seem like good options without my having to purchase a 3rd party software to accomplish this...
    I must admit... Because I've been stuck in Web Design and Motion Graphics for the past couple of years, when I re-opened my old print work from the CS4 days into CS6 it is obvious I have some catch up to do....
    I was almost embarrassed to admit I had forgotten the technique of Alias one color to another using Ink Manager... I had to look it up and found this helpful tutorial http://indesignsecrets.com/alias-one-color-swatch-to-another.php
    Thanks for both solutions....

  • Can I transfer time machine image from one MacBook to another if both have same OS version and both have same size hard drive?

    I purchased a MacBook Pro in December 2010.  Got it with 500GB, 7200 RPM hard drive.  Used Time Machine to create back up. Gave the computer to my son last week and just purchased a new generation MacBook Pro with the same hard drive as old Mac.  I have had issues with bootcamp on new Mac so I removed the partition and now new Mac will not boot without holding down Option key. I know I can do a re-install of the OS.   But, can I use the Time Machine back up from the old Mac to restore the new Mac to look just like the old Mac?  Partition and all?  I did have bootcamp working just fine on the old Mac.  Put lots of software on it that I now don't have on the new Mac (but would like to have).  So, am I just hopeful or can I use the Time Machine back up from the old Mac to restore my my Mac?  If so, how do I do it.  I am a recent PC convert who is pretty good on PC, but a babe in the woods on my Mac.

    No.  Time Machine won't get your boot camp partition back.  There are excellent utilities that move entire hard drive contents among hard drives such as SuperDuper! and CCC, but as far as I know they don't work with boot camp partition.  My suggestion: reinstall Mac OSX on your new Mac (you don't want to hold Option key to start it everytime anyway), partition it with boot camp exactly (or similarly) as you did to your previous Mac (install the same operating system, which should be one of the Microsoft Windows I assume).  Use Migration Assistant as kaz-k suggested to move all the stuff on the Mac partition of your previous Mac.  Reboot both your Macs from the boot camp partition - I assume they are all on Windows platform.  Now you have two computers on Windows platform.  Use Norton Ghost or similar tools to migrate all the stuff from your old machine to your new machine.  Hope this helps.  Backup all your data before such operation.  Good luck.

  • Can't open my InDesign CS6 documents

    All my saved doc will not open. I get the following message:
    Cannot open "name of doc.indde" because it was saved by a newer version of Adobe InDesign (CS7.0)
    I don't even have CS7...in fact does it even exist ?
    Plz help

    I'm not sure if the error message is updated to "Adobe InDesign (CC 9)" or something, if InDesign CS6 is updated to the latest version v8.0.2 …
    You can examine a indd file from a script you can run with InDesign:
    Jongware
    [Ann] Identify Your InDesign File
    http://forums.adobe.com/message/4071273#4071273
    Uwe

Maybe you are looking for

  • If than statement not working in this instance....  can you check it out?

    I have four text fields                                                        (READ ONLY) FIELD A                5                         FIELD B FIELD E                10                       FIELD F Currently running Adobe pro v11.0 User can ent

  • Viewing multiple rows in a database.

    Hey, I've been stuck on a problem for a while now. I know that JDBC 1.0 does not allow scrollable resultsets or provide a rowcount method. I know because of this two resultsets are needed,one to get the number of rows and the other to get the values

  • Macbook Pro retina monitor cable

    I have a Macbook pro with retina display.  what cable do I need to connect it to a 23" Cinema Display that has a DVI connection

  • Outbound plug, confusing error message: no navigational link attached

    Hello, I just finished the WebDynpro Quiz tutorial and deployed the application. Unfortunately when pressing the start button the application dumps and I get a stack trace    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Cannot navigat

  • How the data populated into tables like USR01,USR02 etc

    Hi, I have one theoritical doubt. How the data is populated into tables like USR01, USR02 etc after creating the user using SU01. Let me know the process behind it. Rgds, Chandra.