Skip navigation
Currently Being Moderated

Access to workstation name

Apr 20, 2012 1:02 AM

Tags: #data #javascript #system #scripting #acrobat_x_pro #acrobat_10_pro

Hi:

Is there a way to access any "system" variables with Acrobat JavaScript?  I haven't been able to find anything (other than Date()) in the references.  This is outside the scope of core JavaScript, as far as I know.

 

In particular, I want to be able to pluck the workstation name string and insert it in a footer.

 

Thank you in advance.

 

-- Roy Zider

 
Replies
  • Currently Being Moderated
    Apr 20, 2012 1:20 AM   in reply to FUBARinSFO

    There isn't a direct way to do that, but I think it might be possible by

    smartly manipulating the various results provided by app.getPath().

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 20, 2012 2:41 PM   in reply to FUBARinSFO

    I'm not talking about path, which returns the full path of a file

    (including the drive letter, by the way), but about app.getPath() which can

    return various system- and user-level folders used by Acrobat. Many times

    these contain the name of the currently logged-in user, as well as some

    other information.

    Maybe you can be a bit more specific about what exactly you want to get?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 20, 2012 2:47 PM   in reply to FUBARinSFO

    With Acrobat JS not the workstation ID. File paths and URL for a  PDF stored on a network drive is possible:

     

    console.println("\nthis.URL:\n" + this.URL);
    console.println("\nthis.path:\n" + this.path)

    this.URL:
    file:///H|/My%20DocumentsISR/Adobe/Console.pdf

     

    this.path:
    /ORDHOME.CHICAGO.ISRWORLDWIDE.COM/GEORGE$/My DocumentsISR/Adobe/Console.pdf

    true

     

    You could use additional Acrobat  JS to extract the path or remove the file name and extension.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 21, 2012 6:44 AM   in reply to FUBARinSFO

    this.path.substring(1,2) will return the drive letter where the current

    file is located.

    I don't think you can get the local name of the workstation using

    app.getPath(), though. You can get the name of the current user...

     
    |
    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