5 Replies Latest reply on May 28, 2009 10:46 PM by John.Kordas

    #targetengine "session"

      Hi All,

      I have placed a script with menu items in de Startup Scripts folder.
      The uncompiled version works fine, the binary doesn't.

      I get a message that the object does not longer exist with the binary version.

      It must have something to do with #targetengine "session".

      Is there a solution for this?

      Thanks Michel
        • 1. Re: #targetengine "session"
          Level 1
          By the way, I use CS3 and javascript on the mac.

          • 2. Re: #targetengine "session"
            Level 1
            I think that's a limitation. I seem to remember reading about it here before. Can you work around it by having your binary script write a script to a temporary file, run it with a doScript and then delete the temporary file? That might work.

            • 3. Re: #targetengine "session"
              Level 1
              I found what the problem is.
              Binary scripts can't switch to a specific script engine.

              The solution is in the menuitem loader samplescripts
              in de scripts folder of CS3 and CS4.

              • 4. Re: #targetengine "session"

                I've just come across the same issue. If anyone can tell me which of the examples in the menus folder to look at that would be great.


                Cheers, John.

                • 5. Re: #targetengine "session"
                  John.Kordas Level 1

                  This simple script works as a jsx file but as soon as you export it as a jsxbin it does not work. Any suggestions?


                  #targetengine "session"
                  var myDialog = new Window('palette','Starting Pg No');
                      myDialog.dPgNo = myDialog.add('panel',undefined,'File details');
                      myDialog.dPgNo.alignChildren = 'left';
                      myDialog.dPgNo.myPgNo = myDialog.dPgNo.add('group');
                      myDialog.dPgNo.myPgNo.myGroup = myDialog.dPgNo.myPgNo.add('group');
                      myDialog.dPgNo.btnGroup = myDialog.dPgNo.add('group');
                      with (myDialog.dPgNo){
                          myPgNo.myGroup.orientation = 'column';
                          myPgNo.myGroup.alignChildren = 'right';
                          myPgNo.myGroup.preferredSize = [90,15];
                          myPgNo.myGroup.st  = myPgNo.myGroup.add('statictext',undefined,'Your Doc starting page is:');
                          myPgNo.et = myPgNo.add('edittext', undefined, app.activeDocument.pages[0].name)
                          btnGroup.btn = btnGroup.add('button', undefined, 'Update');
                          btnGroup.alignment = 'right';


                  myDialog.dPgNo.btnGroup.btn.onClick = function() {
                      var myPagestart = myDialog.dPgNo.myPgNo.et.text;
                      if (app.activeDocument.pages[0].name != myPagestart){
                          app.activeDocument.pages[0].appliedSection.continueNumbering = false;
                          app.activeDocument.pages[0].appliedSection.pageNumberStart = parseInt(myPagestart);
                          app.activeDocument.pages[0].appliedSection.sectionPrefix = "";
                          alert("Your document start page has been changed to "+myPagestart+".");