Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I get a delay value of animation timeline?

New Here ,
Jul 27, 2016 Jul 27, 2016

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.

TOPICS
Actions and scripting
605
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 30, 2016 Jul 30, 2016

Are you sure the file is Frame Animation?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2016 Aug 01, 2016

Без имени-1.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2016 Aug 01, 2016

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;

  }

}

Capture.jpg

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2016 Aug 01, 2016

line 316

var T = executeAction(charIDToTypeID('getd'), actionDescriptor, DialogModes.NO);

Adobe Photoshop Version: 14.0

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2016 Aug 01, 2016

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

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2016 Aug 01, 2016

Thank you! Yes it is Adobe Photoshop CC 14.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2016 Aug 01, 2016

Do you know, how to do it in СС version?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2016 Aug 01, 2016
LATEST

I did not know how to do it at all. All I did wat try the code you posted.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines