4 Replies Latest reply: Sep 18, 2013 6:21 AM by saigon80 RSS

    need to pause the action

    saigon80 Community Member

      I have one action with 15 steps . How can the action pause at 7th and 11th step in 5 seconds ? I insert Stop but after the action stops I have to click play button to continue- it takes time. Thanks for your help.

        • 1. Re: need to pause the action
          c.pfaffenbichler Community Member

          At the worst it should be possible to create a Script that gets the current time and then gets the time again and again until the difference between the original and the current one are larger than a certain number.

           

          But have you done a Forum search yet?

          Somedody else may know of a better approach and I suspect the issue may have come up before. 

          • 2. Re: need to pause the action
            Michael L Hale Community Member

            You can use the built-in action pause playback option but you will need to create two scripts. One to set the option to pause and the second to set it back normal.

             

            function setPlayback( optionID, seconds ) {
                //stringIDToTypeID('accelerated')
                //stringIDToTypeID('pause') 
                // second argument required only when id = pause
                var desc = new ActionDescriptor();
                    var ref = new ActionReference();
                    ref.putProperty( charIDToTypeID('Prpr'), charIDToTypeID('PbkO') );
                    ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
                desc.putReference( charIDToTypeID('null'), ref );
                    var optionsDesc = new ActionDescriptor();
                    optionsDesc.putEnumerated( stringIDToTypeID('performance'), stringIDToTypeID('performance'), optionID );
                    if(seconds!=undefined) optionsDesc.putInteger( stringIDToTypeID('pause'), seconds );
                desc.putObject( charIDToTypeID('T   '), charIDToTypeID('PbkO'), optionsDesc );
                executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
            };
            setPlayback( stringIDToTypeID('pause') , 5 );
            

            and

             

            function setPlayback( optionID, seconds ) {
                //stringIDToTypeID('accelerated')
                //stringIDToTypeID('pause') 
                // second argument required only when id = pause
                var desc = new ActionDescriptor();
                    var ref = new ActionReference();
                    ref.putProperty( charIDToTypeID('Prpr'), charIDToTypeID('PbkO') );
                    ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
                desc.putReference( charIDToTypeID('null'), ref );
                    var optionsDesc = new ActionDescriptor();
                    optionsDesc.putEnumerated( stringIDToTypeID('performance'), stringIDToTypeID('performance'), optionID );
                    if(seconds!=undefined) optionsDesc.putInteger( stringIDToTypeID('pause'), seconds );
                desc.putObject( charIDToTypeID('T   '), charIDToTypeID('PbkO'), optionsDesc );
                executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
            };
            setPlayback( stringIDToTypeID('accelerated') );
            

            Then where you need the pause have the action run those two scripts.

            • 3. Re: need to pause the action
              c.pfaffenbichler Community Member

              Good one!

              As I practically never use it I hadn’t even remembered/noticed that there was a duration setting for the Playback Options’ Pause.

              • 4. Re: need to pause the action
                saigon80 Community Member

                Thanks Michael Hale alot ! That's great and help me save time working with hundreds of images .