Creating and editing scripts in the Script Editor

You can use the Script Editor to create or edit scripts by typing the required ACLScript syntax, or by using one of the other methods for entering syntax. When you create or edit a script you must ensure that each command is entered on a separate line.

To create or edit a script in the Script Editor:

  1. Complete one of the following steps to open the script in the Script Editor:
    • To create a new script, select File > New > Script.

    • To open an existing script, right-click the script in the Overview tab in the Navigator and select Edit.

  2. Complete any of the following steps, or use them in combination, to create a script:
    • Manually enter syntax

      Add, modify, or delete ACLScript syntax in the Script Editor. The Script Editor includes auto-completion for ACLScript commands and keywords, and automatic on-screen help for function parameters.

      Pressing Ctrl+Z allows you to Undo one or more actions. Ctrl+Y allows you to Redo one or more actions. Ctrl+S saves the ACL project, including the open script.

    • Copy and paste syntax

      Copy and paste syntax from another script, or from the Results tab.

    • Copy and paste syntax from the command log

      Select the checkbox beside one or more commands in the Log tab in the Navigator and right-click in the Log tab and select Copy. In the Script Editor, position the cursor where you want to insert the command(s) and right-click and select Paste.

    • Use syntax capture or the Script Recorder

      Insert command syntax automatically for one or more commands by clicking Start Syntax Capture  in the Script Editor toolbar and by using the ACL menus and dialog boxes to run commands with the required parameters. While syntax capture is enabled the command syntax is automatically inserted in the script, but the commands are not processed. Click End Syntax Capture  to stop inserting command syntax in the script.

      Syntax capture is distinct from the Script Recorder, which is a separate tool that records commands as they are executed by ACL. For more information, see Creating scripts with the Script Recorder.

    • Import scripts or snippets from ScriptHub

      Click ScriptHub Access  in the Script Editor toolbar to display the Paste ACL ScriptHub content link dialog box. Click Paste to paste a ScriptHub ID from the clipboard and then click Done to import scripts or snippets from ScriptHub.

      For more information, see Importing scripts from ScriptHub.

  3. Optional. Position the cursor at an appropriate place in a script and complete any of the following steps to insert one or more specific items:
    • Project item name (table, script, view, workspace, or index)

      Right-click and select Insert > Project Item to display the Insert Project Item dialog box. Select the type of item from the Item Type drop-down list, select one or more item name(s), and click OK.

    • Field name

      Click Insert Field  in the Script Editor toolbar to display the Insert Fields dialog box. Select one or more field name(s) and click OK.

    • Expression

      Click Insert Expression  in the Script Editor toolbar to display the Expression Builder dialog box. Create an expression and click OK.

      For more information, see Creating expressions using the Expression Builder.

    • Dialog box

      Click Build New Dialog  in the Script Editor toolbar to display the Dialog Builder. Create a custom dialog box, click Close, and click OK.

      For more information, see Creating custom dialog boxes.

    • Date and time

      Right-click and select Insert > Date & Time to display the Date & Time Selector dialog box. Enter or select a date, datetime, or time and click OK.

    • ACL GRC token

      Right-click and select Insert > ACLGRC Token to insert an ACL GRC authentication token in the script. The Sign in to ACL GRC dialog box is displayed and after you enter your ACL GRC account email and password and sign in, the token is pasted in the script.

  4. Optional. Select an existing ACLScript command in the script and click Edit Command  in the Script Editor toolbar to edit the command parameters using the associated dialog box.

    You can only use this method for commands that have dialog boxes.

  5. Select File > Save Project.

    If you run or step through a script, all open scripts are automatically saved.

  6. Click Yes in the confirmation dialog box.
  7. If you want to test the script by running it, or by stepping through it, click Run  or Step  in the Script Editor toolbar.
  8. If you are creating or editing analytics and want to open the project as an analysis app, click Open as Analysis App  in the Script Editor toolbar.

(C) 2015 ACL Services Ltd. All Rights Reserved.