Copy link to clipboard
Copied
function getDelay (theFrameIndex)
{
try
{
var actionReference = new ActionReference();
actionReference.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationFrameDelay'));
actionReference.putIndex(stringIDToTypeID('animationFrameClass'), theFrameIndex);
var actionDescriptor = new ActionDescriptor();
actionDescriptor.putReference(charIDToTypeID('null'), actionReference);
var T = executeAction(charIDToTypeID('getd'), actionDescriptor, DialogModes.NO);
return T.getDouble(stringIDToTypeID('animationFrameDelay'))
}
catch(ex)
{
alert(ex);
return null;
}
}
I want to get the value of the stringIDToTypeID ( 'animationFrameDelay'). But the code falls with an error.
Copy link to clipboard
Copied
Are you sure the file is Frame Animation?
Copy link to clipboard
Copied

Copy link to clipboard
Copied
That script function posted seems to work. You need to use it. Something like this
var frameNumber = "Not a Number";
while (isNaN(frameNumber)) {var frameNumber = prompt("Frame Number ?", "1");}
alert("Frame Number " + frameNumber + " deley is = " + getDelay(frameNumber));
function getDelay (theFrameIndex) {
try {
var actionReference = new ActionReference();
actionReference.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('animationFrameDelay'));
actionReference.putIndex(stringIDToTypeID('animationFrameClass'), theFrameIndex);
var actionDescriptor = new ActionDescriptor();
actionDescriptor.putReference(charIDToTypeID('null'), actionReference);
var T = executeAction(charIDToTypeID('getd'), actionDescriptor, DialogModes.NO);
return T.getDouble(stringIDToTypeID('animationFrameDelay'))
}
catch(e) {
alert(e + ': on line ' + e.line);
return null;
}
}

Copy link to clipboard
Copied

line 316
var T = executeAction(charIDToTypeID('getd'), actionDescriptor, DialogModes.NO);
Adobe Photoshop Version: 14.0
Copy link to clipboard
Copied
Is that Photoshop Elements 14 or Photoshop CC Photoshop Version 14? If Elements that function my not be included which means that its not available like the message indicates.
However the manage indicates the error is on line 316 so we do not know how the script your using is coded. What the actionDescriptor is?
I just tried Photoshop CC that function is not available in CC. It is also not available in CC 2014. It is available in CC 2015 Photoshop version 16
Copy link to clipboard
Copied
Thank you! Yes it is Adobe Photoshop CC 14. ![]()
Copy link to clipboard
Copied
Do you know, how to do it in СС version?
Copy link to clipboard
Copied
I did not know how to do it at all. All I did wat try the code you posted.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now