5 Replies Latest reply on Jan 13, 2012 6:19 AM by c.pfaffenbichler

    How to create a New Set of Actions with script?

    Pedro Cortez Marques Level 3

      Is this possible?

       

      I have manage to go fullscreen and exit full screen with 1 second interval within actions.

       

      But I fail to create a Temporary SET folder for the insert menu item action

       

      Here are the scripts:

       

       

       

      // =======open full screen======================

      var idslct = charIDToTypeID( "slct" );

          var desc9 = new ActionDescriptor();

          var idnull = charIDToTypeID( "null" );

              var ref8 = new ActionReference();

              var idMn = charIDToTypeID( "Mn  " );

              var idMnIt = charIDToTypeID( "MnIt" );

              var idscreenModeFullScreen = stringIDToTypeID( "screenModeFullScreen" );

              ref8.putEnumerated( idMn, idMnIt, idscreenModeFullScreen );

          desc9.putReference( idnull, ref8 );

      executeAction( idslct, desc9, DialogModes.NO );

       

      // wait 1sec

      $.sleep(1000);

       

      // ===========out of fullscreen================

      var idslct = charIDToTypeID( "slct" );

          var desc6 = new ActionDescriptor();

          var idnull = charIDToTypeID( "null" );

              var ref5 = new ActionReference();

              var idMn = charIDToTypeID( "Mn  " );

              var idMnIt = charIDToTypeID( "MnIt" );

              var idscreenModeStandard = stringIDToTypeID( "screenModeStandard" );

              ref5.putEnumerated( idMn, idMnIt, idscreenModeStandard );

          desc6.putReference( idnull, ref5 );

      executeAction( idslct, desc6, DialogModes.NO );

       

      // =========erase actions set 1===========================

      var idDlt = charIDToTypeID( "Dlt " );

          var desc7 = new ActionDescriptor();

          var idnull = charIDToTypeID( "null" );

              var ref6 = new ActionReference();

              var idASet = charIDToTypeID( "ASet" );

              ref6.putName( idASet, "Set 1" );

          desc7.putReference( idnull, ref6 );

      executeAction( idDlt, desc7, DialogModes.NO );

        • 1. Re: How to create a New Set of Actions with script?
          c.pfaffenbichler Level 9

          What steps exactly do you want to have in the Script?

          What is the deleting at the end supposed to do?

           

          Edit:

          var idMk = charIDToTypeID( "Mk  " );

          var desc138 = new ActionDescriptor();

          var idNw = charIDToTypeID( "Nw  " );

          var idASet = charIDToTypeID( "ASet" );

          desc138.putClass( idNw, idASet );

          executeAction( idMk, desc138, DialogModes.ALL );

          1 person found this helpful
          • 2. Re: How to create a New Set of Actions with script?
            Pedro Cortez Marques Level 3

            That's it! Thanks.

             

             

            All I had to change was DialogModes.NO instead of your DialogModes.ALL

            It creates Set 1 automatically

             

             

            Well, this Set 1 will be erased at the end because I only need it to call fullScreen mode of an active image for a 1 or 2 seconds and then go back to normal view and also delete SET 1.

            If I don't remove Set 1 it will create it and the users don't need or use.

             

             

            Explanation:

            I'm testing to use this script before I save an image or a batch of images. Hundreds of them. I need to detect rapidly if I forgot some cleaning detail.

            Unfortunetly, I wanted to wait not 1 second but just stop there and continue the script after I press ESC. Not possible keyboard detection in the middle of a running script.

             

             

            Question:

            >> May I change later the name SET 1 to other not so default name? How I input that on your script?

             

             

            Tks

            • 3. Re: How to create a New Set of Actions with script?
              c.pfaffenbichler Level 9

              May I change later the name SET 1 to other not so default name? How I input that on your script?

              It would be better to name the ActionSet right away, but I frankly don’t know how.

               

              Unfortunetly, I wanted to wait not 1 second but just stop there and continue the script after I press ESC. Not possible keyboard detection in the middle of a running script.

              What exactly do you want to do while the Script halts? Would you need to zoom in and move the canvas around or do any other operations?

               

              Well, this Set 1 will be erased at the end because I only need it to call fullScreen mode of an active image for a 1 or 2 seconds and then go back to normal view and also delete SET 1.

              Say what?

              Full Screen Mode and Standard Screen Mode could be invoked from Script. 

              var idslct = charIDToTypeID( "slct" );
              var desc69 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
              var ref49 = new ActionReference();
              var idMn = charIDToTypeID( "Mn  " );
              var idMnIt = charIDToTypeID( "MnIt" );
              var idscreenModeFullScreenWithMenubar = stringIDToTypeID( "screenModeFullScreenWithMenubar" );
              ref49.putEnumerated( idMn, idMnIt, idscreenModeFullScreenWithMenubar );
              desc69.putReference( idnull, ref49 );
              executeAction( idslct, desc69, DialogModes.ALL );
              
              var idslct = charIDToTypeID( "slct" );
              var desc67 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
              var ref47 = new ActionReference();
              var idMn = charIDToTypeID( "Mn  " );
              var idMnIt = charIDToTypeID( "MnIt" );
              var idscreenModeStandard = stringIDToTypeID( "screenModeStandard" );
              ref47.putEnumerated( idMn, idMnIt, idscreenModeStandard );
              desc67.putReference( idnull, ref47 );
              executeAction( idslct, desc67, DialogModes.ALL );
              
              1 person found this helpful
              • 4. Re: How to create a New Set of Actions with script?
                Pedro Cortez Marques Level 3

                Great! Simpler is better. But... I still can not see the image (REFRESHED on screen) in while is sleeping. I only need some eye attention for details on image. The fit on screen is OK (see code).

                I don't need to zoom or move.

                 

                I can I refresh the screen view of the image to meke sure that the image appears refreshed on screen before the sleeping 2 seconds time start?

                 

                 

                // fit on Screen

                var id57 = charIDToTypeID( "slct" );

                    var desc15 = new ActionDescriptor();

                    var id58 = charIDToTypeID( "null" );

                        var ref6 = new ActionReference();

                        ref6.putEnumerated( app.charIDToTypeID( "Mn  " ), app.charIDToTypeID( "MnIt" ), app.charIDToTypeID( "FtOn" ) );

                    desc15.putReference( id58, ref6 );

                executeAction( id57, desc15, DialogModes.NO );

                 

                // fullScreen (without menu bar):

                var idslct = charIDToTypeID( "slct" );

                var desc69 = new ActionDescriptor();

                var idnull = charIDToTypeID( "null" );

                var ref49 = new ActionReference();

                var idMn = charIDToTypeID( "Mn  " );

                var idMnIt = charIDToTypeID( "MnIt" );

                var idscreenModeFullScreen = stringIDToTypeID( "screenModeFullScreen" );

                ref49.putEnumerated( idMn, idMnIt, idscreenModeFullScreen );

                desc69.putReference( idnull, ref49 );

                executeAction( idslct, desc69, DialogModes.NO );

                 

                // wait 2 seconds:

                $.sleep(2000);

                 

                // PROBLEM UNSOLVED: I can't  see the image (the screen doesn't refresh before the 2 seconds stop.

                 

                // standard Screen:

                var idslct = charIDToTypeID( "slct" );

                var desc67 = new ActionDescriptor();

                var idnull = charIDToTypeID( "null" );

                var ref47 = new ActionReference();

                var idMn = charIDToTypeID( "Mn  " );

                var idMnIt = charIDToTypeID( "MnIt" );

                var idscreenModeStandard = stringIDToTypeID( "screenModeStandard" );

                ref47.putEnumerated( idMn, idMnIt, idscreenModeStandard );

                desc67.putReference( idnull, ref47 );

                executeAction( idslct, desc67, DialogModes.ALL );