Skip to main content
nimazz
Participant
Jun 29, 2011 7:45 AM UTC
Answered

How to get the windows username in jsx

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 is closed to new replies. Start a new post to keep the conversation going.
tomaxxi
tomaxxiCorrect answer
Inspiring
Jun 29, 2011 7:58 AM UTC

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/

10 replies

tomaxxi
tomaxxiCorrect answer
Inspiring
Jun 29, 2011 7:58 AM UTC

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/

Translate
nimazz
nimazzAuthor
Participant
Jun 29, 2011 10:23 AM UTC

Hi Marijan,

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

Regards

Nima

Translate
nimazz
nimazzAuthor
Participant
Jun 29, 2011 7:54 AM UTC

Hello,

I found the answer .

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

this works fine.

Regards

Translate