Skip to main content
April 14, 2016
Answered

How to get current timeline frame number using jsx?

  • April 14, 2016
  • 1 reply
  • 1547 views

How to get current timeline frame number using jsx?

This topic has been closed for replies.
Correct answer

Thanks for the link!

Clarification: I was looking for current frame on Video Timeline. OP there mentions that he had found how to get that so I searched around a bit more and found this thread: Re: Can I read/write inpoint and outpoint of clips in a Video Group with scripting? They have the following function, I have not tried it out yet but it looks like it should work.

function getCurrentFrame(){

   try{

      var ref = new ActionReference();

      ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('currentFrame'));

      ref.putClass(stringIDToTypeID('timeline'));

      var desc=new ActionDescriptor();

      desc.putReference(charIDToTypeID('null'), ref);       

      var TC=executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);

      return TC.getInteger(stringIDToTypeID('currentFrame'));

   }catch(e){return null;}

};

1 reply

oliverIntergrafika
Inspiring
April 15, 2016

This topic maybe give You a workaround. But I am still curious, how is it possible.

Is there a way to get the current timeline frame number in Frame Animation mode?

Correct answer
April 18, 2016

Thanks for the link!

Clarification: I was looking for current frame on Video Timeline. OP there mentions that he had found how to get that so I searched around a bit more and found this thread: Re: Can I read/write inpoint and outpoint of clips in a Video Group with scripting? They have the following function, I have not tried it out yet but it looks like it should work.

function getCurrentFrame(){

   try{

      var ref = new ActionReference();

      ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('currentFrame'));

      ref.putClass(stringIDToTypeID('timeline'));

      var desc=new ActionDescriptor();

      desc.putReference(charIDToTypeID('null'), ref);       

      var TC=executeAction(charIDToTypeID('getd'), desc, DialogModes.NO);

      return TC.getInteger(stringIDToTypeID('currentFrame'));

   }catch(e){return null;}

};

April 19, 2016

Got home, tried it out, works! Thanks again