• Arbortext’s ACL Language – Part 1

    ACL language is the command line tool, similar to other tools, like Perl or C used inside the Arbortext Editor tools. It provides a way to control the editor or make changes to a document. It can control dialogs and interface to other software components. In the next couple of articles, I will describe how to use ACL to accomplish some simple and some complex tasks. I will be giving examples as I go.

    ACL, as a scripting language, has common constructs such as:

    • variables and arrays
    • functions
    • works with files
    • modifies documents
    • callbacks and hooks to handle events

    Syntax

    The syntax usually proceeds a command name followed by a argument(s). Blocks of commands can be added into functions. For example, the help command, by entering the word help, on the command line, will start the help file.

    Note: the command line needs to be displayed. If not visible, turn it on from the File > Tools > Preferences pick the Category, “Window” and make sure the Command Line item is checked.

    Command Line Preference

    Commands

    From the Arbortext Command Line, type help and enter a return. This command will launch the help file.

    command line entering a command

    Functions

    Functions are more complex and allow for multiple commands or functions into a block of code. Functions often, but not always, return a value. The syntax is functionname (argument, argument, …). A simple function username() can be run from the command line.

    Function Usernane

    When you ran the function from the command line, you would notice that there wasn’t any output, pop-ups or results presented in the status area. However, it did not generate an error, so it completed your request. If you misspelled the function, it would generate an error response in the status area (see below).

    Error on the command line

    To see results, we will add the response() function to get the result of the user’s name function. Since, response() is a function itself , the username() function will go inside the response() function or inside the parenthesize .

    Tip: Pressing the arrow up key selects a previous command from your command history; similarly, the arrow down key selects the next command.

    Getting a response from a function

    The results generate a Response box (click OK to dismiss).

    results from the function username

    This entry was posted on Saturday, April 25th, 2009 at 3:32 pm and is filed under ACL, Arbortext Editor. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 3 Comments

    Take a look at some of the responses we have had to this article.

    1. Doug F.
      Dec 16th

      Thank you for your postings on ACL. The only resource I’ve been able to find on ACL is the reference provided by PTC. While reference guides have their place, they aren’t the best material from which to learn a new language. An instructional introduction such as yours is much appreciated.

    2. Dec 19th

      Thanks for the comment. I will try to add more ACL content. My day job is so busy it become a night job as well. I will post soon. Thanks…

    3. Rakesh Pandey
      Feb 4th

      well done, finally we have something about ACL.

      Please add something about callbacks and hooks to handle events.

  • Leave a Reply

    Let us know what you thought.

  • Name(required):

    Email(required):

    Website:

    Message: