Copy link to clipboard
Copied
How to convert windows file path into An Extendscript File object. (that is app.project.item(index).replace(file)
app.project.item(index).mainSource.file
It's difficult to answer fully without understanding where you're trying to get the replacement file path from. Are you just trying to copy / paste it from the file explorer?
I'm not especially familiar with dealing with this issue but it's probably related to the backslash character being reserved for escape characters (you might want to google that). So if you're not careful handling those strings those backslashes will vanish completely. If you were getting replacement paths using something l
...Copy link to clipboard
Copied
It's difficult to answer fully without understanding where you're trying to get the replacement file path from. Are you just trying to copy / paste it from the file explorer?
I'm not especially familiar with dealing with this issue but it's probably related to the backslash character being reserved for escape characters (you might want to google that). So if you're not careful handling those strings those backslashes will vanish completely. If you were getting replacement paths using something like a file select dialog then this wouldn't be an issue anyway, only if you were copy/pasting it from somewhere.
Instead of a backslash I think either a forward slash or two backslashes would work. It doesn't need to look exactly like that screengrab, there are a number of filepath formats accepted:
var theFile = new File("E:\\Automate Editing\\second.....");
var theFile2 = new File("E:/Automate Editing/second.....");
alert("exists = " + theFile.exists + " " + theFile2.exists);
alert(theFile.absoluteURI + " " + theFile2.absoluteURI);
Copy link to clipboard
Copied
yes it worked i used File(path) with \\ for file path. Thanks a lot.