Copy link to clipboard
Copied
I'm using PS2022 and PS2024 for testing on MacOS Ventura 13.6.
For some reason, Extendscript is not treating /Users/USERNAME/Desktop/FOLDER as an absolute path. This code (with a valid path) returns false when checking folder.exists:
var folder = new Folder('/Users/USERNAME/Desktop/FOLDER');
var files = folder.getFiles();
// Check if the folder exists
if (folder.exists) {
alert("Folder exists.");
} else {
alert("Folder does not exist.");
}
If the path is changed to this, then folder.exists returns true:
var folder = new Folder('/Volumes/Macintosh HD/Users/USERNAME/FOLDER');
When I use the function 'Folder.selectDialog' I get a string like the path in the first example - without Volumes/Drive - which should be a valid absolute path. In my previous testing it worked fine, but that was on a different machine.
If I need the Drive info in the path, how can I grab that?
Thanks in advance!
Copy link to clipboard
Copied
Just curious why you aren't using the more common relative path to the desktop?
'~/Desktop/FOLDER'