Copy link to clipboard
Copied
I am writing a script that exports the frame animation information from Photoshop timeline to a json file our game can load. I have it exporting the frame order, names and delays just fine now, but I can't find a way to access whether the entire animation is set to loop once, 3 times, forever, etc. I have seen some scripts on how to set the loop count, but nothing about how to read it?
Much thanks for any help!
#target photoshop
alert (getAnimationLoopCount ());
////// get framedelay //////
function getAnimationLoopCount (theIndex) {
var ref = new ActionReference();
ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationLoopCount'));
ref.putEnumerated(stringIDToTypeID('animationClass'), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));
var desc=new ActionDescriptor();
desc.putReference(charIDToTypeID('null'), ref);
var aaa = executeAction(charIDToTypeID('getd'), desc, DialogModes
...Copy link to clipboard
Copied
#target photoshop
alert (getAnimationLoopCount ());
////// get framedelay //////
function getAnimationLoopCount (theIndex) {
var ref = new ActionReference();
ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationLoopCount'));
ref.putEnumerated(stringIDToTypeID('animationClass'), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ));
var desc=new ActionDescriptor();
desc.putReference(charIDToTypeID('null'), ref);
var aaa = executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);
return aaa.getInteger(stringIDToTypeID('animationLoopCount'))
};
Copy link to clipboard
Copied
This works perfectly, thanks so much!!!!!