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

ExtendScript importFiles() bug?

Guest
Sep 25, 2017 Sep 25, 2017

I have a CEP panel which is downloading a proxy video from an external source then scripting its import into Premiere Pro. Currently I'm running Premiere Pro on Windows (10).

The panel is currently downloading to the system temporary directory, but it looks like Premiere Pro or ExtendScript is massaging the supplied file name, which is causing an error for some reason. For example if the panel downloads to:

C:\Users\Philip\AppData\Local\Temp\2017-09-23T215101Z_1_LWD0012KBA6VB_RTRWNEV_C_6151-STORM-MARIA-DOMREP.MP4

then this is pushed into Premiere Pro with app.project.importFiles ([File(fileName)]) then the application pops up an error dialog:

File Import Failure

~\AppData\Local\Temp\2017-09-23T215101Z_1_LWD0012KBA6VB_RTRWNEV_C_6151-STORM-MARIA-DOMREP.MP4

Unsupported format or damaged file.

Note that:

a) The file itself is fine and I can manually import it into Premiere Pro successfully.

b) If I change the panel so it downloads to a directory outside of the home/library area, for example "C:\temp" then the importFiles() call also works file. This isn't a very satisfactory workaround though as it means hardwiring the download location.

It looks like maybe there's an inconsistency in the handling of the file name; the fully qualified Windows file name is being converted to a Unix/OSX "~" relative file name, but then Premiere Pro can't make use of that file name.

Is this a bug?

TOPICS
SDK
2.3K
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 , Sep 25, 2017 Sep 25, 2017

I can't repro the behavior you've described. We don't do any 'free' conversion of paths.

This works fine:

var file = new File('~\\Desktop\\aaa.mxf');

var fs = file.fsName;

app.project.importFiles([file.fsName]);

This also works fine:


app.project.importFiles(["C:\\Users\\bbullis\\Desktop\\aaa.mxf"]);

Do you see the same issue if you download to the user's Desktop? The interwebs suggest that Windows may do Special Thingsâ„¢, around temp directory privileges.

Translate
Adobe Employee ,
Sep 25, 2017 Sep 25, 2017

What's the full path you're passing to importFiles()?

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
Guest
Sep 25, 2017 Sep 25, 2017

Hi Bruce

It's exactly the path I mentioned, ie.

*C:\Users\Philip\AppData\Local\Temp\2017-09-23T215101Z_1_LWD0012KBA6VB_RTRWNEV_C_6151-STORM

-MARIA-DOMREP.MP4*

(with backslashes escaped).

Thanks

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 ,
Sep 25, 2017 Sep 25, 2017

I can't repro the behavior you've described. We don't do any 'free' conversion of paths.

This works fine:

var file = new File('~\\Desktop\\aaa.mxf');

var fs = file.fsName;

app.project.importFiles([file.fsName]);

This also works fine:


app.project.importFiles(["C:\\Users\\bbullis\\Desktop\\aaa.mxf"]);

Do you see the same issue if you download to the user's Desktop? The interwebs suggest that Windows may do Special Thingsâ„¢, around temp directory privileges.

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
Guest
Sep 25, 2017 Sep 25, 2017

For some reason it's behaving differently for me, and it's the same with Temp and Desktop.

Here's the same file from Desktop:

app.project.importFiles ([File("C:\\Users\\Philip\\Desktop\\2017-09-23T232910Z_1_LWD0012KBADZB_RTRWNEV_C_6160-STORM-MARIA-PUERTO-RICO-DAM-AERIALS.MP4")]);

desktop-import-1.PNG

and having renamed it, just in case that was it:

app.project.importFiles ([File("C:\\Users\\Philip\\Desktop\\test1.MP4")]);

desktop-import-2.PNG

but I can copy the same file to C:\temp, and then:

app.project.importFiles ([File("C:\\temp\\test1.MP4")]);

works just fine.

I can believe that the application isn't deliberately doing any deliberate conversion on the file name, but what is converting the {{user library base}} part of the fully qualified file name to "~" in that case?

The other thing that seems strange (or significant) is that selecting import manually in Premiere Pro and then choosing any of the files in Temp or Desktop works OK too. That seems to suggest that it's something to do with scripting rather than the file names, directories, or permissions.

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 ,
Sep 25, 2017 Sep 25, 2017

Above, you're creating a ExtendScript File object, then attempting to pass it to a function that takes a path. I'm very surprised that works for you, in your "works just fine" case, above.

A File object has a member named .fsName, that contains the full path. Try that; better?

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
Guest
Sep 25, 2017 Sep 25, 2017

You're dead right, that solves it. Since the object model viewer help just says "Project.importFiles (arg1:any)" it wasn't clear to me what the argument was meant to be, and I happened to find some sample code which passed a File object, which worked for all but user directories, and etc etc etc ...

Strange that it does behave so differently for different directories though.

Thanks again

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 ,
Sep 25, 2017 Sep 25, 2017
LATEST

Never a problem.

When in doubt about PPro ExtendScript API, work from the examples in PProPanel:

Samples/PProPanel at master · Adobe-CEP/Samples · GitHub

At your convenience, write me (at my day job; bbb@adobe.com) with an overview of the workflows you'd like to support, and I can provide better guidance.

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
Engaged ,
Sep 25, 2017 Sep 25, 2017

It looks like there's an embedded space in the path. after "STOR".

I have a vague recollection that I needed to escape embedded spaces to get it to work. Worth a try anyway.

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
Guest
Sep 25, 2017 Sep 25, 2017

Thanks Bob,

I'll bear that in mind and add some escaping, but it looks like that particular space has appeared as the result of some cut&pasting or line wrapping. It's not in the actual file name anyway.

Thanks

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