Creating Hello World plugin

Step 1: Create folder for your plugin

To start writing a new plugin, open %AppData%\Blumentals\WeBuilder\plugins folder (you can simply copy the path as-is to Windows Explorer address bar) and create a new folder. Choose any name you like such as hello world.

Step 2: Create plugin.ini

Create plugin.ini file. You can do it from WeBuilder.

  1. On the File menu, select New, click Text document.
  2. On the File menu, click Save As.
  3. Navigate to the folder you just created for your plugin.
  4. Enter plugin.ini in File name field and click Save.
  5. Fill in plugin.ini with following content:
    [Blumentals WeBuilder Plugin]
    name=Hello World
    enabled=1
    lang=fs
    entry=script.js
    author=Your name here
    about=My first plugin
    version=1.0
    

    Values marked bold must be changed for each new plugin that you create.

  6. Save the changes.

entry specifies plugin's initialization script name.

Step 3: Create script.js

Create script.js in WeBuilder.

  1. On the File menu, select New, click JavaScript source.
  2. On the File menu, click Save As.
  3. Navigate to the folder of your plugin.
  4. Enter script.js in File name field and click Save.
  5. Fill in script.js with following content:
    function ShowHelloWorld(Sender) {
      alert("Hello world!");
    }
    
    Script.RegisterAction("", "Hello World", "", &ShowHelloWorld);
    
  6. Save the file.

Step 4: Test your plugin

Restart WeBuilder. On the Plugins menu, click Hello World. If everything was done correctly, that should display Hello World! for you.

Step 5: Package plugin for distribution

After plugin has been created, you might want to install it on other computers or distribute it in Blumentals Forums. To do so, plugin must be packaged for installation.

Open your plugin's folder in Windows Explorer. Select all files. Right click, select Send to, click Compressed (zipped) folder. Zip file will be created. Rename it to represent your plugin's name and the package is ready.

Notes

  • You probably already noticed that main plugin code is placed inside functions. The main body of plugin is executed during WeBuilder initialization. During this phase script should only register required actions, connect functions to signals and create required forms and controls if any. No text/window manipulation must occur during initialization phase. If you need to do something like that during startup then use ready and installed signals.