Skip to main content
nimazz
Participant
June 29, 2011
Answered

How to get the windows username in jsx

  • June 29, 2011
  • 2 replies
  • 3169 views

Hello,

I have a JSX script in "My Documents\Adobe Scripts" to make it trusted script. I have another text file I need to read from JSX. Since the location depends on logged in user, I need to find the windows username. If anyone know how to get the windows username from jsx please reply.

Thank you very much.

Regards

Nima.

This topic has been closed for replies.
Correct answer tomaxxi

Hey,

You can get username like this:

var myUsername = $.getenv('username');

You could also get My Documents folder like this:

var myDocFolder = Folder.myDocuments;

Hope that helps.

--

Marijan (tomaxxi)

http://tomaxxi.com/

2 replies

tomaxxi
tomaxxiCorrect answer
Inspiring
June 29, 2011

Hey,

You can get username like this:

var myUsername = $.getenv('username');

You could also get My Documents folder like this:

var myDocFolder = Folder.myDocuments;

Hope that helps.

--

Marijan (tomaxxi)

http://tomaxxi.com/

nimazz
nimazzAuthor
Participant
June 29, 2011

Hi Marijan,

That's was helpful. thanks for the quick response.

Regards

Nima

nimazz
nimazzAuthor
Participant
June 29, 2011

Hello,

I found the answer .

alert ($.getenv("USERNAME"));

this works fine.

Regards