How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: xbytor, DavideBarranca, Paul MR

AnilTejwani
Posts: 15
Joined: Wed Feb 22, 2017 5:37 pm

How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Postby AnilTejwani » Fri Jan 25, 2019 10:56 am

Hi Guys,

I was wondering if it would be possible to convert the jsx path (example /d/ps-projects/a/b/c/) to windows path (i.e. d:/ps-projects/a/b/c/ or d:\ps-projects\a\b\c\)

Thanks in advance.

Anil

Geoff
Posts: 2
Joined: Thu Jan 24, 2019 8:18 pm

Re: How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Postby Geoff » Fri Jan 25, 2019 11:19 am

$.writeln(decodeURI(activeDocument.fullName.fsName));

Geoff
Posts: 2
Joined: Thu Jan 24, 2019 8:18 pm

Re: How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Postby Geoff » Fri Jan 25, 2019 1:32 pm

Sorry you just wanted the path....

$.writeln(decodeURI(activeDocument.path.fsName));

AnilTejwani
Posts: 15
Joined: Wed Feb 22, 2017 5:37 pm

Re: How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Postby AnilTejwani » Sat Jan 26, 2019 1:52 am

$.writeln(decodeURI(activeDocument.fullName.fsName));
Thanks Geoff.
What i was missing was the .fsName bit, which I understand would be File System Name.

Thanks once again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~oO~~Oo~^~~~
http://bit.ly/photoshopScripting
http://bit.ly/ts-timeslice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

supriyala
Posts: 1
Joined: Tue Mar 05, 2019 9:54 am

Re: How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Postby supriyala » Wed Mar 06, 2019 4:25 am

Excellent topic. I got valuable information from here. thank you!

tocnaza
Posts: 1
Joined: Fri Mar 22, 2019 10:25 am

Re: How to get/convert Windows path not /d/ps-projects/ but D:\ps-projects\

Postby tocnaza » Fri Mar 22, 2019 10:27 am

Hello Anil!

$.writeln(decodeURI(activeDocument.path.fsName));

Best regards,


Return to “Photoshop Scripting - General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest