Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Sep 16, 2015 Sep 16, 2015

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

TOPICS
Scripting
839
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 16, 2015 Sep 16, 2015

use

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

Translate
Adobe
Community Expert ,
Sep 16, 2015 Sep 16, 2015

use

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 17, 2015 Sep 17, 2015
LATEST

YES! That works! Thanks Carlos!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines