Skip to main content
Participant
October 21, 2018
Answered

Can't access sequence tracks or markers through ExtendScript

  • October 21, 2018
  • 2 replies
  • 1096 views

I'm using the following code in the ExtendScript Toolkit:

var seq = app.project.activeSequence;

alert(seq.name); // This returns the correct sequence name, so seq is not null

var tracks = seq.videoTracks;

alert(tracks.length); // This returns 'undefined' and is the start of my headaches

To confirm there are definitely video tracks on my sequence. I've tried this with new projects, new sequences, adding and deleting video tracks, locking and unlocking them but nothing seems to work. Have I missed something obvious?

Also, on a slightly related note, I am having problems accessing the markers on the sequence. The following seems bizarre:

var seq = app.project.activeSequence;

var markers = seq.markers;

alert(markers.length); // Returns 'undefined'

var newMarker = markers.createMarker(1); // Successfully adds a marker at one second.

alert(markers.length); // Returns 'undefined'

Thanks,

Pete

This topic has been closed for replies.
Correct answer Bruce Bullis

var tracks = seq.videoTracks;

alert(tracks.length); // This returns 'undefined' and is the start of my headaches

Try tracks.numTracks instead.

 

alert(markers.length); // Returns 'undefined'

Try markers.numMarkers instead.

alert(seq.projectItem); // This also returns 'undefined'.

That's because there's no way to put a projectItem in an alert; try alert(seq.projectItem.name) instead.

All the members discussed above are visible in ExtendScript Toolkit's Data Browser, while running scripts in PPro.

2 replies

Bruce Bullis
Bruce BullisCorrect answer
Legend
October 30, 2018

var tracks = seq.videoTracks;

alert(tracks.length); // This returns 'undefined' and is the start of my headaches

Try tracks.numTracks instead.

 

alert(markers.length); // Returns 'undefined'

Try markers.numMarkers instead.

alert(seq.projectItem); // This also returns 'undefined'.

That's because there's no way to put a projectItem in an alert; try alert(seq.projectItem.name) instead.

All the members discussed above are visible in ExtendScript Toolkit's Data Browser, while running scripts in PPro.

Participant
October 30, 2018

You are a beautiful person, I hope you realise that!

Big cheers for pointing out the Data Browser (which I had looked at before but got scared because it looked like Matrix code to me, but now it makes sense to a useful extent), in addition to addressing my problem directly.

Bruce Bullis
Legend
October 30, 2018

Feel free to reach out with questions, here or directly (day job = b b b at adobe dot com).

What're you building?

Participant
October 22, 2018

alert(seq.projectItem); // This also returns 'undefined'.

This seems wrong also - surely for a sequence to exist there has to be a project item? Even if this isn't the case, the sequence is listed in the project window (along with the video and item files being used). I really feel like I'm going crazy with this, I'm convinced I'm missing something simple.

Kevin J. Monahan Jr.
Legend
October 30, 2018

Pete,
I moved your post to a more appropriate forum. Let us know if you have trouble here.

Thanks,

Kevin

Kevin Monahan - Sr. Community and Engagement Strategist – Adobe Pro Video and Audio