Skip navigation
Currently Being Moderated

Script that returns the name of the user

Sep 17, 2009 9:24 AM

Greetings, I have a fairly intricate script that exports text from an InCopy document. This is InCopy CS3 and runs on a Windows 2003 platform. It would be valuable for this script to know who the user is, that is who is executing the export. Has anybody written a script that would pull the username and AD group from the  OS, or for that matter from InCopy. The solution, I think, may be in calling an external script that queries the OS and returns that kind of data. Any thoughts on this subject would be appreciated. Thks, Wil

 
Replies
  • Currently Being Moderated
    Sep 17, 2009 9:40 AM   in reply to Wil James

    This works on the Mac:

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

     

    On Windows you can probably go to the command prompt and type "set" to list the available environment variables, I don't know whether AD set such a variable.

     

    Dirk

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 17, 2009 11:07 PM   in reply to Wil James

    On Windows you can get the name of the user like this:

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

    or

    alert((Folder.temp + "").slice (12,-14));

     

    Kasyan

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points