Get timeline frame number?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

pecollinni
Posts: 1
Joined: Sat Oct 21, 2017 7:42 pm

Get timeline frame number?

Post by pecollinni »

Basicly, I'm trying somehow to get this:

[img]
capture.png
capture.png (13.4 KiB) Viewed 9293 times
[/img]

I've tried everything I could think of but no luck. Currently I'm trying to pull of the data using executeActionGet() function but I think I'm not constructing the action descriptors and references well... not shure how they actually works.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: Get timeline frame number?

Post by txuku »

Bonjour

Do you do this in javascript or do you use the ScriptlisteneJS.log?

Can you show the code used and the data you want?

:)
User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Re: Get timeline frame number?

Post by Jaroslav Bereza »

Code: Select all


	var ref = new ActionReference();
ref.putProperty(stringIDToTypeID('property'), stringIDToTypeID('time'));
ref.putClass(stringIDToTypeID('timeline'), stringIDToTypeID('timeline'));
var desc = executeActionGet(ref); // <- it's here inside desc

Code: Select all


var time_Seconds = desc.getObjectValue(stringIDToTypeID('time')).getInteger(stringIDToTypeID('seconds'))
var time_Frame = desc.getObjectValue(stringIDToTypeID('time')).getInteger(stringIDToTypeID('frame'))
var time_FrameRate = desc.getObjectValue(stringIDToTypeID('time')).getDouble(stringIDToTypeID('frameRate'))
schroef
Posts: 33
Joined: Sat Apr 11, 2020 6:22 am

Re: Get timeline frame number?

Post by schroef »

@Jaroslav Bereza

Could you perhaps explain how to use this?
I see comparisons to code from scriptlistner. I tried using your version but keeps telling me "this command is not available"

This is code extracted from scriptlistner. I see parts which match, kindof.

Code: Select all

// Move playhead 1 second
        var idsetd = charIDToTypeID( "setd" );
        var desc36 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        var ref18 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idtime = stringIDToTypeID( "time" );
        ref18.putProperty( idPrpr, idtime );
        var idtimeline = stringIDToTypeID( "timeline" );
        ref18.putClass( idtimeline );
        desc36.putReference( idnull, ref18 );
        var idT = charIDToTypeID( "T   " );
        var desc37 = new ActionDescriptor();
        var idseconds = stringIDToTypeID( "seconds" );
        desc37.putInteger( idseconds, 0 );
        var idframe = stringIDToTypeID( "frame" );
        desc37.putInteger( idframe, +1 );
        var idframeRate = stringIDToTypeID( "frameRate" );
        desc37.putDouble( idframeRate, 24.000000 );
        var idtimecode = stringIDToTypeID( "timecode" );
        desc36.putObject( idT, idtimecode, desc37 );
        executeAction( idsetd, desc36, DialogModes.NO );
Really wish Adobe opened Pandora's box on timeline scripting. Ive read so many posts now, even posts from internal Adobe people stating its BLACK MAGIC. Lots of code is so old never touched and no one seems to know how it works?!
schroef
Posts: 33
Joined: Sat Apr 11, 2020 6:22 am

Re: Get timeline frame number?

Post by schroef »

Sorry nevermind me... I should have checked the code better and re-read it. I thought this was executing commands and putting timeline at a certain point.

This is super great!!!!

How did you find this?