Skip to main content
September 18, 2013
Question

need to pause the action

  • September 18, 2013
  • 1 reply
  • 783 views

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.

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
September 18, 2013

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. 

Inspiring
September 18, 2013

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.

c.pfaffenbichler
Community Expert
Community Expert
September 18, 2013

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.