Code snippets in the Script Editor

You write your script in the Script editing pane. You can write code from scratch or import existing snippets.

You can create your own custom Code Snippet

Prerequisites

  • You have created a new script or imported an existing one.

Procedure

  1. Right-click on the Script editing pane and select Code Snippets.

    Make sure your script is in editing mode. There should be an open-lock-symbol next to your script in the Application component pane.

    script editor codesnippit

    Result: The code snippets dialog opens.

  2. Browse or search for a code snippet in the menu on the left.

  3. Click the snippet to see the full code.

  4. Click Copy to paste the code in your Script editing pane. The dialog closes automatically.

Types of code snippets

Neptune DXP - Open Edition provide a wide range of code snippets on your disposal. Here are some categories:

Generated

Code snippets generated according to your resources that are include in your script

Custom

Custom code snippets. Check code snippet Code Snippets for more details.

Basic JavaScript

Basic JavaScript code snippets are simple examples that illustrate the fundamental concepts and syntax of the JavaScript programming language. They are typically used to demonstrate core functionalities.

Code snippet dialog

script editor snippet dialog

Results

  • You have added a code snippet to your script.