5 Replies Latest reply on Dec 17, 2017 9:21 PM by JJMack

    Convert Active Document File Path to Windows Format

    johnt53984649 Level 2

      Observe the following lines of code:

       

      #target Photoshop
      var joy = app.activeDocument.path;
      alert(joy);
      

       

      Test this when you have some file open in Photoshop.  For example, it outputs something that looks like this:

      /d/5)%20Projects/My%20Projects

      but I need it to look like this:

      D:\5) Projects\My Project

      Now, let me make this clear; I need it in EXACTLY the format that I showed immediately above.  I'm working on a Windows machine, and I need to return this filepath in the Windows format for my HTML panel so that the user has easy access to it.  I need it to be just a standard string that includes the spaces and doesn't add in those extra percent signs and twenties.  Unfortunately, I have no idea how to do this.

       

      So the real question here is; how can I obtain the active document's file path in the typical Windows format?