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

bad argument ImportFiles when executing CEP panel

Contributor ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Dear friends, I'm new to CEP panels and Javascript.

I'm trying to import image sequence from folder on click event in CEP panel.

Here is my function:

function openDocument(){
var InsertIntoTrack = 1;
var overwrite = false;

app.project.importFiles("D:\\Destination_folder\\File_000.png", true, null, false);

}

When clicking the button in my CEP panel I got error  "bad argument ImportFiles".

Could you tell me what is wrong with my function?

Yaroslav.

TOPICS
Import , SDK

Views

798

Translate

Translate

Report

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

Contributor , Jun 07, 2021 Jun 07, 2021

Here is a description of importFiles() function from the docs:

https://ppro-scripting.docsforadobe.dev/general/project.html?highlight=importfile#project-importfiles

app.project.importFiles(filePaths, suppressUI, targetBin, importAsNumberedStills);

// importAsNumberedStills is a boolean value, if true images will be imported as sequence.

If I remember right you need to import the very first file in you sequence. The file you import acts as a first file in an image sequence, e.g.:

- first imported fi

...

Votes

Translate

Translate
Contributor ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

I've maneged to make it work partially by modifying the code like this:

function openDocument(){
var file = new File('mypath\\File_000.png');
var fs = file.fsName;
app.project.importFiles([file.fsName]);
}

It imports single file File_000.png. 

However, I need to import the whole image sequence. File_000.png, File_001.png and so on.

I've read this thread

https://community.adobe.com/t5/premiere-pro/importing-images-as-a-sequence-in-adobe-premiere-pro-usi...

where it is said that I should add additional parameters to  app.project.importFiles().

 

But then, which file shall I pass as a first argument?  The first in image sequence (File_000.png)?

Or, may be the destination folder?

 

 

 

 

  

Votes

Translate

Translate

Report

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
Contributor ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Here is a description of importFiles() function from the docs:

https://ppro-scripting.docsforadobe.dev/general/project.html?highlight=importfile#project-importfile...

app.project.importFiles(filePaths, suppressUI, targetBin, importAsNumberedStills);

// importAsNumberedStills is a boolean value, if true images will be imported as sequence.

If I remember right you need to import the very first file in you sequence. The file you import acts as a first file in an image sequence, e.g.:

- first imported file: file_000.png, you will get image sequence: file_000 - file_999.png

- first imported file: file_666.png, you will get image sequence: file_666 - file_999.png

Votes

Translate

Translate

Report

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 ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

> But then, which file shall I pass as a first argument? 

 

None. As seen in the example usage, the first parameter must be an ARRAY of file paths.

Votes

Translate

Translate

Report

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
Contributor ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

LATEST

Dear Ivan,

thank you for a quick answer.

Bruce, thank you as well for an illuminating remark.

It finally worked! For future references I post a working example:

var file = new File('the_path\\File_000.png');
var fs = file.fsName;
app.project.importFiles([fs], true, app.project.getInsertionBin(),true);

Yaroslav.

Votes

Translate

Translate

Report

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