Share

Writing Scripts

Write scripts using Fusion Manage's Script Editor and Debugger.

  1. On the Administration menu, mouse over System Configuration and click Scripting.

    scripts tab

  2. On the Scripting page, click New Script.

    Tip:

    To automatically select the script type, click the New ... Script link on the corresponding expanding pane.

Script Editor Elements

script callout

  1. Script Type The type of script you are writing. Action is the default selection. For help on script types, see Scripting Basics.

  2. Unique Name A unique identifier for the script (for example, InspectionPassedFailed). The identifier is what you reference when you set up the script trigger. For help on script triggers, see Running Scripts.

  3. Description A descriptive name for the script (for example, Ensure all inspection tasks are Pass or n/a).

  4. Imports Import one or more Library scripts into the new script. Click the button and then select from the drop-down.

  5. Enable Code Complete Turn on contextual scripting assistance.

  6. Pick Workspace Select the workspaces that Code Complete uses to determine context as you type.

    Note: Only workspaces you have permission to view are available. If the script is used in other workspaces, those workspaces are listed automatically and cannot be removed. When a workspace no longer uses the script, it the workspace will not be listed as a context for the script.
  7. Code Code text box to write and edit your script.

  8. Command Buttons Save - Save the script and keep the editor open. Save and Close - Save the script and close the editor. Test - Test and debug the script. Cancel - Close the editor without saving.

Code Complete

Code Complete provides contextual scripting assistance by suggesting and completing the names of relevant functions and fields as you code. Item details such as the system name, the display name, the data type, and the workspace are presented in a drop-down list as you type. PLM objects and functions are also suggested within the context of your code.

code complete

Display the Suggestion List

The suggestion list is displayed automatically as you type. Press any of the following key combinations to manually display the list while editing:

  • CTRL+Space
  • CTRL+SHIFT+Space
  • ALT+Space

Accept a Suggestion

  • Press Enter to accept the first item in the list or use the cursor keys to select a different suggestion and then press Enter.
  • Use the mouse to scroll through the list of suggestions and then click your selection.

Code Complete analyzes your code and warns you if any objects reference unknown dynamic information. The script is analyzed when Code Complete is first enabled and each time a new line is started.

Was this information helpful?