Skip to main content
Participant
February 28, 2018
Answered

Is there a way to pause the history ?

  • February 28, 2018
  • 1 reply
  • 1334 views

Hi there!

Is there a way to pause the history ?

I do not want to record the process of moving the layer in the history.

function proc()

{

    var layerActive = app.activeDocument.activeLayer ;

    pause history

    layerActive.translate( mx, my ) ;

    resume history

}

Or is there a way to move a layer without recording it ?

Thank you.

This topic has been closed for replies.
Correct answer Davide_Barranca12040269

There's no history pause, but history suspend – which is a way to provide a single history state for the entire script (one single undo for all actions taken in the script)

app.activeDocument.suspendHistory('Secret step!', 'main()');

function main() {

  // whatever needs to be done

}

Hope this helps,

Davide

1 reply

Davide_Barranca12040269
Legend
February 28, 2018

There's no history pause, but history suspend – which is a way to provide a single history state for the entire script (one single undo for all actions taken in the script)

app.activeDocument.suspendHistory('Secret step!', 'main()');

function main() {

  // whatever needs to be done

}

Hope this helps,

Davide

Davide Barranca - PS developer and authorwww.ps-scripting.com
TakupyAuthor
Participant
March 1, 2018

I see.

I just barely made it.

Thank you!