Skip to main content
Inspiring
February 12, 2024
Answered

File path loaded into photoshop

  • February 12, 2024
  • 2 replies
  • 1553 views

I would like to see an alert window with the path to the original file.

 

This topic has been closed for replies.
Correct answer Stephen Marsh

here I am
then the situation is this
this string is not good to fit uxp
Window.alert(app.activeDocument.fullName);

this is fine for me but not for uxp
Window.alert(app.activeDocument.path.fsName);

this one is fine for uxp but not for me
because it gives me the entire path plus the file name
app.activeDocument.path

what I need is the first example
/user/username/folder

 


quote

what I need is the first example
/user/username/folder

 


By @Ciccillotto

 

 

Try the following regular expression capture group addition:

 

require('photoshop').core.showAlert(app.activeDocument.path.replace(/(^.+\/)(.+)/, "$1"));

 

 

2 replies

Legend
February 12, 2024

A one line script:

Window.alert(app.activeDocument.fullName);
Inspiring
February 12, 2024

Thanks, just what I was looking for.

 

Conrad_C
Community Expert
Community Expert
February 12, 2024

If you just want to know where the file is, right-click the document tab and choose Reveal In Finder/Explorer.

 

If you’re using macOS, you can also use the standard macOS shortcut of right-clicking the name in the title bar to reveal the full path to the document. This works only for a document floated as a window, because a tabbed document doesn’t display the standard macOS title bar.