Correct way to use getSequence with GUID?

I’m trying to open a sequence by GUID — specifically to support a roundtrip where I pass the GUID string to a webview, then bring it back on the UXP side and reconstruct it with fromString(guidString).

This works fine:

export const openSequences = async () => {
  const project = await premierepro.Project.getActiveProject();
  const sequences = await project.getSequences();
  for (const seq of sequences) {
    await project.openSequence(seq);
  }
};

But this doesn’t work:

export const openSequences = async () => {
  const project = await premierepro.Project.getActiveProject();
  const sequences = await project.getSequences();
  for (const seq of sequences) {
    const fetched = project.getSequence(seq.guid);
    await project.openSequence(fetched);
  }
};

What’s the correct way to use getSequence(guid) so I can reconstruct and open a sequence from a GUID string passed back from the webview?

Did you try to “await” on the getSequence() call ?

I have not tried it, but I’m guessing the variable fetched is not set to what you think it is ( probably set to a Promise instead of an actual Sequence)

Try to replace
const fetched = project.getSequence(seq.guid);
with
const fetched = await project.getSequence(seq.guid);

1 Like

That works! turns out my types are just incorrect lol.
Thank you!

2 Likes