Skip to main content
Inspiring
July 22, 2016
Answered

Hard-code a save as path?

  • July 22, 2016
  • 1 reply
  • 341 views

Hello,

I have a working script which saves my active document as a .jpg file.

It includes the following line of code which outputs the saved jpg to the same directory as the psd file.

var filePath = srcDoc.path + '/' + docName + '.jpg';

Could someone please advise me how I hard-code this variable to point to the OS X desktop?

I have tried these 2 options - to no avail:

var filePath = /Desktop + '/' + docName + '.jpg';

var filePath = "/Desktop" + '/' + docName + '.jpg';

Thank you all in advance.

This topic has been closed for replies.
Correct answer pixxxelschubser

var aFile = File ("~/Desktop/Testdateien/Sample.jpg");

Does this helps you?

1 reply

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
July 22, 2016

var aFile = File ("~/Desktop/Testdateien/Sample.jpg");

Does this helps you?

Inspiring
July 22, 2016

Danke Sehr!  (Thank you very much)