Copy link to clipboard
Copied
My file is here:
"C:\Users\first.last\Desktop\PS_Tester\SRC\Work.psd"
Note that doc is on the desktop (Windows).
This code:
var MyTest = activeDocument.fullName;
alert(MyTest);
Returns:
"~/Desktop/PS_Tester/SRC/Work.psd"
I would like and expect it to return the actual path with the "C:\Users\first.last" and not the "~".
When I pass the ~Path to another app madness occurs.
Or is there a way to get what the tilde represents?
Just a slight correction, for the alert. using a forward slash isn't keeping with what you'll get returned, which will be all the normal backslashes. You need a double backslash:
alert(MyTest+"\\"+app.activeDocument.name);
Copy link to clipboard
Copied
activeDocument.fsName;
Copy link to clipboard
Copied
that returns "undefined" ???
But it got me going in the correct direction:
var MyTest = (app.activeDocument.fullName.parent).fsName;
Returns:
"C:\Users\first.last\Desktop\PS_Tester\SRC\"
Which gets me something without a tilde.
Thanks for the pointer!
Copy link to clipboard
Copied
Hi Mrapelje,
Try This Code..
var MyTest = (app.activeDocument.path).fsName;
(or)
var MyTest = (app.activeDocument.fullName.parent).fsName;
alert(MyTest+"/"+app.activeDocument.name);
- yajiv
Copy link to clipboard
Copied
Just a slight correction, for the alert. using a forward slash isn't keeping with what you'll get returned, which will be all the normal backslashes. You need a double backslash:
alert(MyTest+"\\"+app.activeDocument.name);
Copy link to clipboard
Copied
You are correct sir... I had a couple of lines that added the file name and fixed all the slashes.