Skip to main content
Inspiring
March 21, 2024
Answered

importFiles() not working on macOS Monterrey 12.6

  • March 21, 2024
  • 1 reply
  • 205 views

Hello there,

Gonna go directly to the problem 😄


I created a script that takes footage form AE and places it in a sequence in Premiere Pro. It works well on windows 11, but on macOS it does not import the files.


Here is how I get the path for the files, in After Effects:

 

fileName = app.project.activeItem.layer(1).source.file.absoluteURI;

 

The layer is checked, the file exists. This works on windows 11, as I mentioned.
 
This is the way I try to add the file to Premiere Pro:

 

if (app.project.importFiles(fileName, 0, bin, false)) {
  premiere_logger.info("Successfuly imported file.");
} else {
  premiere_logger.info("Failed to import file");
};

 

premiere_logger is an object that I created that writes inside a file. The result of importFiles() in this case is true, although no file is imported in the project.

bin is a variable that holds the bin that I create previous to calling this function.

 

Does anybody know if I do something wrong? Is this a bug? Is there a workaround to introduce footage inside the project?

 

I have tried this both in AE/PPro 2023 and AE/PPro 2024.

 

Thanks,

Andrei!

 

 

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

>Does anybody know if I do something wrong?

The first param to importFiles() should be an array of file paths, not just one file path. 

I haven't tested it, but I think this'll work:

 

app.project.importFiles([fileName], 0, bin, false)

 

  

[You haven't gotten back to us; I'm going to assume that solved the problem.]

1 reply

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
March 21, 2024

>Does anybody know if I do something wrong?

The first param to importFiles() should be an array of file paths, not just one file path. 

I haven't tested it, but I think this'll work:

 

app.project.importFiles([fileName], 0, bin, false)

 

  

[You haven't gotten back to us; I'm going to assume that solved the problem.]