9 Replies Latest reply on Jan 13, 2009 1:59 PM by Harbs.

    JS: Using CS2 Scripts with CS3

      So, we're a little behind...we're just moving from CS2 to CS3. So please bear with me. (We're using Javascipt)

      Until I'm able to convert all of our scripts to CS3 compatibility, I created a "Version 4.0" folder in the scripts panel, hoping I can use our CS2 scripts as-is.

      One of my CS2 scripts places a snippet on the master pages. Before, it would place by itself with no questions asked. In CS3, the snippet is a loaded cursor wanting me to click to place it. What do I need to change? This is the section of the script

      //Place Master Page items
      myDocument.masterSpreads.item("A-Master").place(
      mcmMasterPage, //the document
      [0,0], //top-left coordinate of text frame
      undefined, //layer
      false, //show options
      false ) //autoflow
        • 1. Re: JS: Using CS2 Scripts with CS3
          Level 1
          That folder name should be "Version 4.0 Scripts" without the quotes.

          I can't see what's wrong with your code, although that first parameter ought to be the snippet file. But given your description of your problem, I'm guessing that it is.

          Dave
          • 2. Re: JS: Using CS2 Scripts with CS3
            Level 1
            My folder is named Version 4.0 Scripts. And, yes..."mcmMasterPage" is the snippet (there is a variable at the top of the script).
            • 3. Re: JS: Using CS2 Scripts with CS3
              Level 1
              If anyone has suggestions for this, I'd really appreciate it. I'm at a loss.

              Basically, I have a "document setup" script that does several things for all of our InDesign users when they start on a document. One of the things it does is place several objects in specific locations on the master pages. I used a snippet so that all of the objects can be placed at once, in the proper place. With CS3, the CS2 script works fine except that the snippet doesn't place without the user having to click.

              If there is a better way to accomplish what I want to do, that's fine. But I don't know what that is. (Do I have to have the script place each object individually? Yuck.)

              Lisa
              • 4. Re: JS: Using CS2 Scripts with CS3
                Level 1
                Lisa,

                Have you tried just using the first two parameters in your call to place? The rest don't seem to do much the way you have them.

                Dave
                • 5. Re: JS: Using CS2 Scripts with CS3
                  Level 1
                  Hi Dave,

                  Just tried, it didn't make any difference.

                  I also just tried placing a snippet (using ctrl+D rather than running a script) in both CS2 and CS3. And that behavior alone is different. In CS2, it just places in its original location. In CS3, it's a loaded cursor I have to click. I even changed the preference under file handling to place snippets in original location. But that didn't work. Maybe there is another new preference setting in CS3 that I'm missing? If so, I can't find it.

                  I'm beginning to think it isn't a script issue, but a difference between CS2 and CS3 in how snippets are handled.

                  Lisa
                  • 6. Re: JS: Using CS2 Scripts with CS3
                    Level 1
                    Lisa,

                    I'm confident that I have placed snippets using CS3, so don't give up. I'm in the middle of a crisis at the moment with two of my four machines failing, so I'm not able to dig out any sample code right now. As soon as I can, I'll post an example, if you haven't sorted it out yourself by then.

                    Dave
                    • 7. Re: JS: Using CS2 Scripts with CS3
                      Harbs. Level 6
                      The search field in ESTK CS4 is great! I just typed in snippet, and this
                      is what I got:

                      DocumentPreference.snippetImportUsesOriginalLocation
                      Data Type: Boolean
                      Adobe InDesign CS4 (CS4) Object Model
                      If true, causes UI-based snippet import to use original location for
                      page items.

                      Sounds like that's what you need...

                      --
                      Harbs
                      http://www.in-tools.com
                      • 8. Re: JS: Using CS2 Scripts with CS3
                        Level 1
                        Dave--No worries. I appreciate your help, and good luck with your crisis.

                        Harbs--I'll try your suggestion, but I'm technically writing a CS2 script, and I don't think that preference existed then. Plus, I've set that preference as a default in the application (CS3), and even placing a snippet without the script wants me to click.

                        For now, users will just have to click on the master page to place the snippet and move on. I'm going to keep trying to figure it out though.

                        Lisa
                        • 9. Re: JS: Using CS2 Scripts with CS3
                          Harbs. Level 6
                          Hi Lisa,

                          Sorry. I just checked, and this preference is new to CS4 (whatever it
                          does...)

                          Two suggestions:

                          1) Try pacing the snippet into a page item instead of directly on the
                          page. There should be no need to click then.
                          2) Why not just reconstruct the snippet programmatically (if you're
                          doing it with a script anyway).

                          --
                          Harbs
                          http://www.in-tools.com