Previous Topic

Next Topic

Book Contents

Book Index

Script Editor

Accredo > Script > Script Editor

Script editing and customisation are recommended for Users with programming skills. Code shown in Script Editor is MaxBasic automation code. To access MaxBasic code in Script Editor, you can either:

To show Line Numbers in the Script Editor, go to Accredo > File > System > Users > Preferences tab, and select Show line numbers in editors. If line numbers are shown, they are included when a script is printed.

To access the Script Editor Context Menu, right-click in the script editor window, or press Shift+F10.

You can insert Automated code snippets in the Script Editor, see Automated Snippets.

Drop down menus

MenuPopup

Operators (Alt+O)

Lists MaxBasic operators.

MenuPopup

Objects (Alt+J)

Lists the objects and components available in the code. When you select a property it will appear in the code.

MenuPopup

Functions (Alt+F)

Lists available MaxBasic functions. When you select a function that expects arguments, parentheses, parameters and commas for the arguments are shown with the pointer at the first argument, for example, InStr(|String1: String, String2: String). This shows that the Instr function requires two string arguments, one before and one after the comma.

Typing the function name in the editor followed by # will also expand the arguments for the function.

Help for a function, detailing the arguments, is available from:

  • The final option in the menu,
  • Pressing F1 - OR -
  • Selecting from the context menu (right-click) with the cursor positioned in the function name in the editor.

MenuPopup

Automated (Alt+A)

Lists Automated objects. Documentation for each object is available from the final option in the menu. You can insert the code to Dim and Create an object by clicking on it.

Typing an Automated object name in the editor followed by # will also Dim and Create the Object..

MenuPopup

Procedures (Alt+E)

Lists Function and Sub procedures defined in the script.

For a full list of all Procedures including imported ones press Ctrl+E or select from the context menu (right-click) to open the Procedure List in a separate window.

MenuPopup

Help (Alt+H)

Access resources including descriptions, documentation and sample code.

 

Snippet (Alt+T)

Insert a code Snippet. Snippets are listed alphabetically, and the first line of each snippet is displayed.

Typing a Snippet name in the editor followed by # will also expand the snipped code.

Editor buttons

ScriptCheck

Check Code (Alt+C)

Checks the code compiles correctly, without running the script.

Breakpoint (Alt+B)

Set a code breakpoint on the current line. Click again to toggle to clear the breakpoint. You can also click to the right of a line to set or clear a breakpoint.

Hover the mouse over a breakpoint, then right-click to make a breakpoint unavailable, or access the Breakpoint Properties.

If a condition has been set for a breakpoint, it will be shown when you hover over the breakpoint.

Run (Alt+R)

Runs the script. To run a script when Script Editor is closed, press Alt+F3 or click on the Accredo toolbar, or setup a script shortcut. To terminate a running script, press Alt+F1. The line and character at which the script was terminated will be displayed.

Print (Ctrl+P)

Print the code. This can be helpful when writing scripts.

 

Capture Status Hints

Selected, you can capture status hints when the script is Run. This is useful for checking the effect of a script.

 

Add Shortcut (Alt+D)

Select to:

  • Add Shortcut - add the script as a Shortcut on the Accredo toolbar and / or the Navigator.
  • Add Script Event - attach the script to a Script Event.
  • View Script Events - view all Script Events. This can be useful for ascertaining whether a script event already exists.

Check and Save
(Alt+K)

Check the code compiles correctly then save the script.

 

Encoding

File encoding for the script is displayed.

Default File Encoding may be changed in System Settings - Encoding.

Saving a file will use the selected encoding.

Load... (Alt+L)

Load an existing script to select the code, run, print or edit.

Click the drop down to view a list of recently saved/loaded scripts.

Scripts are either .pfs text files, or .pfz encrypted files which are decrypted on load.

Save... (Ctrl+S)

Once saved, you can run the script, or setup a script shortcut or script event.

Scripts may be saved as .pfs files which are plain text, or .pfz files which are encrypted.

Note: Saving (and encrypting) and Loading (and decrypting) encrypted scripts in the script editor requires Write permission for Company > Scripts > Encrypted, in addition other scripting permissions.

In This Section

Script Editor - Shortcut keys

Script Editor - Context Menu

Procedure List

Breakpoint Properties

Automated Snippets

Import / Export Designer Code Editor

Encrypted Scripts