Skip to main content
Participant
October 26, 2021
Answered

Create Frame Animation via JSX script

  • October 26, 2021
  • 1 reply
  • 582 views

I'd like to be able to add frame animation to an open PSD file and manipulate it from there. Looking at the ScriptingListener log, I can see that clicking Create Frame Animation in the Timeline window in Photoshop does something like this:

var idhistoryStateChanged = stringIDToTypeID( "historyStateChanged" );
    var desc262 = new ActionDescriptor();
    var iddocumentID = stringIDToTypeID( "documentID" );
    desc262.putInteger( iddocumentID, 249 );
    var idID = stringIDToTypeID( "ID" );
    desc262.putInteger( idID, 253 );
    var idname = stringIDToTypeID( "name" );
    desc262.putString( idname, """Create Frame Animation""" );
    var idhasEnglish = stringIDToTypeID( "hasEnglish" );
    desc262.putBoolean( idhasEnglish, true );
    var iditemIndex = stringIDToTypeID( "itemIndex" );
    desc262.putInteger( iditemIndex, 2 );
executeAction( idhistoryStateChanged, desc262, DialogModes.NO );

The issue is that I have no idea how to find the "documentID" and "ID" I need here to make this general purpose.

Does anyone know how to find these two bits of information?

Thanks.

This topic has been closed for replies.
Correct answer r-bin

try using only this

 

executeAction(stringIDToTypeID("makeFrameAnimation"), undefined, DialogModes.NO);

 

1 reply

r-binCorrect answer
Legend
October 26, 2021

try using only this

 

executeAction(stringIDToTypeID("makeFrameAnimation"), undefined, DialogModes.NO);

 

dalebeckAuthor
Participant
October 26, 2021

Ah, thank you! I saw that in the log after all of the above mess, but assumed the above was required first. But I guess that's all just managing the history to keep things un-doable.

Thank you again for the help!