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

Scripting, Project.importSequences() Error

Explorer ,
Jan 25, 2023 Jan 25, 2023

I'm trying to import a sequence using 

Project.importSequences()

as described here: https://ppro-scripting.docsforadobe.dev/general/project.html?highlight=import%20sequence#project-imp...

 

This is what I did:

 

 

 

path = "E:\\folder\\import.prproj"

sequenceIDs = ['sequence-1']
app.project.importSequences(path, sequenceIDs)

 

 

But I get this errror:

 

 

TypeError: importSequences() takes 2 positional arguments but 3 were given

 

 

 
Any help is appreciated. Thank you!
TOPICS
Error or problem , SDK
1.1K
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

correct answers 1 Correct answer

Adobe Employee , Jan 30, 2023 Jan 30, 2023

Your path variable needs to 'escape' the backslashes; "E:\\path\\untitled.prproj".

Translate
Adobe Employee ,
Jan 26, 2023 Jan 26, 2023

It looks like you're trying to pass sequence.name, instead of an actual sequence.sequenceid. 

You can get the id of a sequence like so:

 

var templateSequenceID = mytemplateSequence.sequenceid;

 

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
Explorer ,
Jan 27, 2023 Jan 27, 2023

Thanks for the suggestion.

I tried this as you suggested:
var templateSequenceID = mytemplateSequence.sequenceid


But got this error:
AttributeError: 'Sequence' object has no attribute 'sequenceid'

 

I also tried:

var templateSequenceID = mytemplateSequence.id

 

And that gave me:
1

 

So I tried:

path = "E:\\folder\\import.prproj"

sequenceIDs = [1]
app.project.importSequences(path, sequenceIDs)



But that also gave me the error:

TypeError: importSequences() takes 2 positional arguments but 3 were given

 

It could be related, so I'm also facing an issue with:

Project.newSequence()

to create a new Sequence object based on the specified preset (.sqpreset file).

 

Here's what I did:

name = 'Sequence 01'

pathToSequencePreset = "C:\\Path\\Template.sqpreset"

app.project.newSequence(name, pathToSequencePreset)

 

Here is the error I get:
AttributeError: 'Project' object has no attribute 'newSequence'

 

Thank you again for any help!

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
Explorer ,
Jan 27, 2023 Jan 27, 2023

I checked the documentation again and fixed the code. Specifically, capitalizing "ID" in Sequence.sequenceID, and I'm now able to get the sequence ID e.g. "2714b58d-10a0-4801-9646-8a4f6f1e2a98".

 

But, when I use it for Project.importSequence(), I'm still getting the error:

TypeError: importSequences() takes 2 positional arguments but 3 were given

 

Here is what I tried:

sequenceIDs = ["2714b58d-10a0-4801-9646-8a4f6f1e2a98"]
path = r"E:\path\project.prproj"
app.project.importSequences(path, sequenceIDs)
 
Error:
TypeError: importSequences() takes 2 positional arguments but 3 were given
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
Explorer ,
Jan 27, 2023 Jan 27, 2023

I checked the documentation and fixed the code. Specifically, capitalizing "ID" in Sequence.sequenceID. I'm now able to get the sequence ID e.g. ""2714b58d-10a0-4801-9646-8a4f6f1e2a98"

 

But, when I use it in Project.importSequences(), I'm still getting the TypeError.

Here is what I tried:

sequenceIDs = ["2714b58d-10a0-4801-9646-8a4f6f1e2a98"]
path = r"E:\path\untitled.prproj"
app.project.importSequences(path, sequenceIDs)
 
Error:
TypeError: importSequences() takes 2 positional arguments but 3 were given
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 Employee ,
Jan 30, 2023 Jan 30, 2023

Your path variable needs to 'escape' the backslashes; "E:\\path\\untitled.prproj".

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
Explorer ,
Jan 30, 2023 Jan 30, 2023

Okay, I've tried that and it still doesn't work.

TypeError: importSequences() takes 2 positional arguments but 3 were given

 

Seems like I'm the only one facing this issue, as a friend tried it on his machine and was able to make it work.

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 Employee ,
Jan 30, 2023 Jan 30, 2023
LATEST

I think those additional 'arguments' are your string, without escaped backslashes...

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 Employee ,
Jan 30, 2023 Jan 30, 2023

Here's what I did:

app.project.newSequence(name, pathToSequencePreset)

 

See PProPanel's example code for making a sequence from a preset.

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