Copy link to clipboard
Copied
Hi All,
I am using app.project.importFiles method to import file. The issue is, it also returns true for the file which failed to import due to any reason e.g. File format not supported / missing audio or video stream. We can't know if the file fails to import. Is this a bug in the premiere pro API? Is there any workaround to check for the import failed scenario?
Suggestion: app.project.importFiles should return false in this case.
Premiere Pro version: 11.0.1
Extension Type: Panel
Thanks & Regards,
Meet Tank
I'm not sure what I was right about; I meant to point out that returning the import status of N files, via 1 return code, could never provide adequate information.
importFiles() is the correct call, in either case.
Copy link to clipboard
Copied
importFiles() takes an array of file paths; what should it return if 5 of 6 imports were successful?
Copy link to clipboard
Copied
Thanks Bruce. Yes, you are right. We have a requirement to import files one by one and display import status of each file so we are using app.project.importFiles method to import a single file. Is there any other method available which imports one file at a time and return import status?
Thanks,
Meet
Copy link to clipboard
Copied
I'm not sure what I was right about; I meant to point out that returning the import status of N files, via 1 return code, could never provide adequate information.
importFiles() is the correct call, in either case.
Copy link to clipboard
Copied
I understand that importFiles() takes an array of file paths. But as I said we want to import one file at a time to fetch import status of the file to check whether that file is imported or not.
e.g.
As per the current implementation of importFiles(), this looks not possible.
Can we have a method called importFile() which takes a string of file path and also return import status?
Thanks,
Meet
Copy link to clipboard
Copied
meett9325076 wrote
Can we have a method called importFile() which takes a string of file path and also return import status?
I'll note the request, but it's the first such request I've heard; you'll need a few more developers to request such behavior, to move such work up in our API backlog...
What would such behavior 'buy' you?
Have you run into many cases where you've used importFiles(), but the import silently fails? I wonder why this has never been reported as a problem, by >250 PPro panel developers...
Copy link to clipboard
Copied
I have faced two such failed cases, but it could more:
Thanks,
Meet
Copy link to clipboard
Copied
I don't see how your proposed new function would help, in either case. PPro would still dutifully try to import those files, and report the problem to the user, unless you've told importFiles() to silence those warnings.
If you really need to double-check that each import happened, today, you could set the target bin to be /TempImportBin (or whatever) before import, then after calling importFiles(), process each projectItem within /TempImportBin into a new bin.
Copy link to clipboard
Copied
Yes, PPro is giving error message to the user for any failed import, but we also want to display the status of the imported file in the extension panel that's why we need status of each file.
"After calling importFiles(), process each projectItem within /TempImportBin into a new bin"
In our case we would have to iterate through projectItem each time after calling importFiles () which looks very indecent as we are displaying file status in the panel immediately after importing a file.
I would appreciate if you could accommodate this change in importFiles() by returning json which has status of each file or provide a new method - importFile() which would return true/false.
Thanks,
Meet
Copy link to clipboard
Copied
JSON = That sounds like JavaScript, not ExtendScript...
Feature requested.