I’m using Photoshop 22.5.3 on Win10, in this part of code I would like to achieve how “Automate-Batch” interface was made(if you click “Choose…”, though folder instead of file, the path will be printed below).
Where and how is your initial filePath variable defined?
You’re setting it as filePath = file.getNativePath();, but accessing as window.filePath. Maybe you should set it also to window.filePath?
I think you’ve mixed up the two ways to get the native path:
You can either read the property directly on an entry: entry.nativePath
Or call the function on the FileSystemProvider with an entry as the parameter: fileSystemProvider.getNativePath(entry)
edit: I just noticed that this is from the XD documentation, not sure if it’s the same for Photoshop currently. Searching the docs for entry or storage does only give me the XD link however.
filePath = file.getNativePath()
Yeah because I can’t directly console.log(filePath) in debugger so I’m thinking about making that a global variable… that’s why I do “window.filePath”.