Skip to main content
Known Participant
March 9, 2009
Question

Get the current absolute path name?

  • March 9, 2009
  • 5 replies
  • 5633 views
How to get the current absolute path and file name in javascript?
This topic has been closed for replies.

5 replies

Paul Riggott
Inspiring
March 11, 2009
You are correct, just tried it on an old laptop with Photoshop CS using Mac OSX and it seems that it creates a temp file and reports that information.
So sorry can't help you with CS.
Known Participant
March 11, 2009
WhoAmI function not working in cs. It not provide the correct path.
Known Participant
March 11, 2009
> WhoAmI function not working in cs. It not provide the correct path.

It cannot be done in CS.

-X
Paul Riggott
Inspiring
March 11, 2009
If using CS3 or CS4
alert($.fileName);
or this should work on all versions.

function WhoAmI() {
var where;
try {var F = FO;
}catch( err ) {where = File(err.fileName);}
return where;
};

NB: Neither will work if you are using binary scripts!
Known Participant
March 11, 2009
Sorry, i need the javascript current path(not input file name path). Because i run my script from outside of the script folder.
Known Participant
March 9, 2009
> How to get the current absolute path and file name in javascript?

app.activeDocument.fullName;

It's in the docs.

-X
Known Participant
August 16, 2016

Saved me again...Cheers xbytor! We lost Mike but thank heaven's we still have you!