Skip to main content
Inspiring
September 17, 2015
Answered

Using Folder.userData to get user's name? (Windows/CS5)

  • September 17, 2015
  • 2 replies
  • 913 views

I am looking for a way for our designers to digitally "sign off" on graphics as they export them, which we do via javascript. Thanks to other posts in this forum, I know how to add text to a textbox via JS, but am having trouble getting the user name info.

I was hoping I could somehow trace the username from one of the Folder options, but it always traces back as a truncated file path that doesn't include the username portion.

So for example when I use this:

alert(Folder.userData.absoluteURI);

my result is:

~/AppData/Roaming

The info I need is where that pesky ~ is! Any ideas on how to get it to give me the full path name?

I have tried:

Folder.userData.absoluteURI

Folder.userData.path

Folder.userData.fullName

Folder.userData.parent

All but .parent give me the same "~/AppData/Roaming" result.

.parent just gave me "~/AppData"

.parent.parent gave me "~"

When I went to .parent.parent.parent it gave me "/c/Users"

Is the username property blocked somehow from being returned? Is there a way around that if so?

Tech Specs: Using Windows 7, Illustrator CS5 64-bit

This topic has been closed for replies.
Correct answer CarlosCanto

use

alert(Folder.userData.fsName); // C:\Users\Carlos\AppData\Roaming

2 replies

RESlyderAuthor
Inspiring
September 17, 2015

YES! That works! Thanks Carlos!!

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
September 17, 2015

use

alert(Folder.userData.fsName); // C:\Users\Carlos\AppData\Roaming