22 Replies Latest reply on May 30, 2012 7:13 AM by John Hawkinson

    Document size changes opening CS3 doc in CS6

    Gonterman1201 Level 1

      (Retitled from "Array in CS 6 NOT WORKING" and originally posted at May 23, 2012 4:06 PM in the InDesign Scripting forum)


      I have used this var from CS3 to CS5.5 and it works but when I try and pass this in CS6 I get undefined.

       

      var myJobEven=["68p2","-45p9","69p4.4","-39"];

       

      Any Ideas. I am sending this info to a text box creation.

        • 1. Re: Array in CS 6 NOT WORKING
          Peter Kahrel Adobe Community Professional & MVP

          var myJobEven=["68p2","-45p9","69p4.4","-39"];

          myTextframe.geometricBounds = myJobEven;

           

          works fine for me. Where do you see 'undefined'?

           

          Peter

          • 2. Re: Array in CS 6 NOT WORKING
            Gonterman1201 Level 1

            This variable is not the problem. The problem is when I open a CS3 or CS4 document in CS6 the document setup does not reflect the actual demensions of the document. The document setup shows letter. But the document is not letter. I am going to post this in someother places as well. Thanks.

            • 3. Re: Array in CS 6 NOT WORKING
              John Hawkinson Level 5

              You need to give us a lot more information. The one line you posted just sets a variable to an array containing four strings. You don't show the script doing anything with that variable, so there's no way we can help you.

              • 4. Re: Array in CS 6 NOT WORKING
                Gonterman1201 Level 1

                I am sorry for the confusion. The problem is that this variable gets passed by in a try because it does not recieve the right info. The reason for this wich I tried to describe is because. When I try and open CS3 or CS4 Files in CS6 the application describes the size as letter. wich is not phisically the case. When the script recieves the wrong dimensions it passes on my array. So when I try to build the text box its demensions are undefined. When I run my script opening a document saved in CS5 or CS5.5 still running from 6 I have no problems. Because the script recieves the right size.

                • 5. Re: Array in CS 6 NOT WORKING
                  John Hawkinson Level 5

                  Your words are just not clear enough.

                   

                  Can you please post a small self-contained script example that demonstrates the problem?

                   

                  It should be small, only enough code to show the problem. (The process of making it small may help you

                  find the problem.)

                   

                  It should be self-contained, so we can run it ourselves and test it. Only then can we be sure we understand your problem.

                  • 6. Re: Array in CS 6 NOT WORKING
                    Gonterman1201 Level 1

                    I know what the problem is its InDesign CS6. Just try opening a  CS3 file in CS6. Then look a the document set up. it will always say letter.

                    • 7. Re: Array in CS 6 NOT WORKING
                      John Hawkinson Level 5

                      I created a CS3 file with A4 dimensions.

                      I open it in CS6. It looks fine:

                       

                      Screen shot 2012-05-26 at 3.47.37 PM.png

                      Also, does that mean this doesn't have anything to do with Scripting? Shall I move it to the general forum?

                      • 8. Re: Array in CS 6 NOT WORKING
                        Gonterman1201 Level 1

                        You can move it if you wish. My file is a custom size. The document size in doc setup changes to letter when I open it in CS6. This does effect my script because my script reads the document size.

                        • 9. Re: Array in CS 6 NOT WORKING
                          John Hawkinson Level 5

                          You can move it if you wish.

                          Done.

                           

                           

                          My file is a custom size. The document size in doc setup changes to letter when I open it in CS6. This does effect my script because my script reads the document size.

                          Well, please give us details. Post the screenshot of the file size in CS3 and then the file in CS6.

                          Maybe the problem is more subtle than you suggest.

                           

                          Saying "my file is a custom size" does not let us help you. If yo usay, "My file is 105mm x 176mm with facing pages" that might be more helpful. But I suggest a screenshot of the whole dialog, because I suspect it is more complicated than you suggest.

                          • 10. Re: Array in CS 6 NOT WORKING
                            Gonterman1201 Level 1

                            Screen shot 2012-CS3.jpg

                             

                            This is the screen shot of the CS3 Document in CS3. Notice the page size says Custom.

                             

                             

                            Screen shot 2012-CS6.jpg

                            This is the same document opened in CS6. Notice the page size is now changed to letter.

                            This does not however effect the physical document. However my script reads page size. When the page size changes to letter

                            I am unable to get the acurate results of my page size.

                            • 11. Re: Array in CS 6 NOT WORKING
                              Peter Spier Most Valuable Participant (Moderator)

                              Try exporting the document from CS3 to .inix, then oepn that in CS6.

                              • 12. Re: Array in CS 6 NOT WORKING
                                [Jongware] Most Valuable Participant

                                > This does not however effect the physical document.

                                 

                                Your second screenshot shows "51p, 66p" as its document size, but your document is still "47p, 75p" as shown in the first one?

                                 

                                >However my script reads page size.

                                 

                                Does this "read" page size exactly match the second -- wrong size -- screenshot value? (I guess it does, but just to make sure...) Just out of curiosity, as I don't have CS6 to experiment with: I guess you are reading "document" page sizes. Can you check what page[x].bounds reports as page size?

                                1 person found this helpful
                                • 13. Re: Array in CS 6 NOT WORKING
                                  Gonterman1201 Level 1

                                  OK, I have done more work on this issue. It appears to be at a document level. The perticular files I am working with seem to be the only files with this problem.

                                  I can not quite understand how an issue on the document level would effect the application in this way. For now I can only wonder.

                                  • 14. Re: Array in CS 6 NOT WORKING
                                    Gonterman1201 Level 1
                                    var myDoc = app.activeDocument;
                                     var myPageSize=myDoc.pages.item(0).bounds;
                                    alert(myPageSize);
                                    
                                    
                                    
                                    
                                    
                                    This gives me a value of -1,-47,74,0 wich is closer to describing the true nature of this page however. When I go to
                                    document set up it still gives a value of 51p 66p should be 47 bt 75.
                                    To make this easier I put the zero point in the upper left 0,0,75,47.
                                    
                                    • 15. Re: Array in CS 6 NOT WORKING
                                      Gonterman1201 Level 1

                                      You know Jongaware, your question I think has given me a solution to my problem. Because I am using

                                      var myPageHeight = (documentPreferences.pageHeight);

                                      var myPageWidth = (documentPreferences.pageWidth);

                                      To find the heighth and width of this page.

                                      Wich is giving me the wrong value because CS6 is giving the wrong value.

                                      But if I use what you suggested.

                                      var myDoc = app.activeDocument;
                                      var myPageSize=myDoc.pages.item(0).bounds;
                                      alert(myPageSize);

                                      I get acurate info. This does not totally make me understand what is happening here. But this is definitley a way forward.

                                      Thank you.

                                      • 16. Re: Array in CS 6 NOT WORKING
                                        Peter Spier Most Valuable Participant (Moderator)

                                        You said this is present only in this one document. That could easily mean there is minor corruption that miught be cleaned by exporting. Did you try the suggestion to export to .inx that I made earlier?

                                         

                                        For what it's worth, there have been enough posts here on the forum about problems with converting legacy files in CS5 and CS5.5, many of which do not show up until a file has been editied and overwritten, that I no longer attempt to open any CS3 file in a newer version directly. Export to .inx, and opening that, and resaving with a new name to avoid overwriting the original has proved to be a very reliable workflow.

                                        • 17. Re: Array in CS 6 NOT WORKING
                                          Gonterman1201 Level 1

                                          I tried Exporting to inx. When I open the document in CS6 all the elements are shifted to the left. 6 different documents

                                          • 18. Re: Array in CS 6 NOT WORKING
                                            Peter Spier Most Valuable Participant (Moderator)

                                            That's pretty odd.

                                            • 19. Re: Array in CS 6 NOT WORKING
                                              Gonterman1201 Level 1

                                              So I went from

                                              var myPageHeight = (documentPreferences.pageHeight);

                                              var myPageWidth = (documentPreferences.pageWidth);

                                               

                                              to this to get my page size and I have solved my problem.

                                              It does not explain why InDesign is giving me letter but I have worked around it.

                                               

                                              var myPageSize=myDocument.pages.item(0).bounds;

                                                              myTop=myPageSize[0];

                                                           myLeft=myPageSize[1];

                                                            myBottom=myPageSize[2];

                                                           myRight=myPageSize[3];

                                                          myPageWidth=myRight-myLeft;

                                                          myPageHeight=myBottom-myTop;

                                              • 20. Re: Array in CS 6 NOT WORKING
                                                John Hawkinson Level 5

                                                I tried Exporting to inx. When I open the document in CS6 all the elements are shifted to the left. 6 different documents

                                                Do you have the same problem with IDML?

                                                 

                                                You should probably file a bug with Adobe Support (http://adobe.com/go/support). I'd point you at http://adobe.com/go/wish but that doesn't allow you to attach files, which may be a problem here.

                                                 

                                                Alternatively, can you provide me with one of the CS3 files that demonstrates this problem?

                                                • 21. Re: Array in CS 6 NOT WORKING
                                                  Peter Spier Most Valuable Participant (Moderator)

                                                  John Hawkinson wrote:

                                                   

                                                  I tried Exporting to inx. When I open the document in CS6 all the elements are shifted to the left. 6 different documents

                                                  Do you have the same problem with IDML?

                                                   

                                                  Not an option in CS3...

                                                  • 22. Re: Array in CS 6 NOT WORKING
                                                    John Hawkinson Level 5

                                                    Do you have the same problem with IDML?

                                                     

                                                    Not an option in CS3...

                                                    Ah, yes. Well, the question is whether CS3's INX is at fault or CS6's INX reading (or some fuzzy area). So I guess we ought to know how that CS3 INX is read in CS4/CS5, and whether IDML from CS4/CS5 causes the same problem.

                                                    Bleh.