Issue with file exists stat API

Participant ,
Nov 25, 2020

Copy link to clipboard

Copied

Hi All,

 

File status API provided in the javascript level window.cep.fs.stat and extendscript level 

file.exists is not worked as expected.

Javascript

For a valid file path in the system source

var result = window.cep.fs.stat(source);
result.err will be non zero which indicates file is not present in the system.
Extendscript
var neFile= new File(path); 
neFile.exists will be false even when path is a valid path
 
Problem exists in both windows and mac.
Is this a known issue?  Is there any work around for this?
Please advice.
 
Thanks
TOPICS
Editing, Error or problem, Performance, SDK

Views

62

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Adobe Employee , Nov 25, 2020
Bruce Bullis Adobe Employee , Nov 25, 2020
This works fine, too.   var myFile = new File('/Users/bbb/Movies/aaa aaa.mxf'); if (myFile){ var exists = myFile.exists; }   Perhaps encodeURI/decodeURI could solve the issue, of special characters (like %20 for space)?

Likes

Translate

Translate
Jump to answer Jump to answer
Adobe Employee ,
Nov 25, 2020

Copy link to clipboard

Copied

ExtendScript File.exists is working correctly for me, on two different systems. In what version of PPro are you testing it?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
emam-dev AUTHOR
Participant ,
Nov 25, 2020

Copy link to clipboard

Copied

Hi Bruce,

 

Premiere pro version 14.6.0 (Build 51)

We came across this issue when file name contains special characters like Test%20Test

 

Thank you

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
Nov 25, 2020

Copy link to clipboard

Copied

This works fine, too.

 

var myFile = new File('/Users/bbb/Movies/aaa aaa.mxf');

if (myFile){
	var exists = myFile.exists;
}

 

Perhaps encodeURI/decodeURI could solve the issue, of special characters (like %20 for space)?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more