Navigation: TextEd > Extension and Scripts >

Create a new extension

 

 

 

FastScript


The script language used is called "FastScript". You can choose between four different syntax types. JScript, C++, Pascal or Basic. Please note that these are only different syntaxes and not different script languages.

 


The user script tools

All user script tools are located in the script menu or on the user toolbar.

 

 

From here you can create a new extension, open an existing one and save it when done. Always open an extension script from here to ensure that highlighting and auto completion is working properly.


To run your extension click on the "Run" button and use the "Stop" button to exit and remove the extension.

 


Create a new extension

Select a script language in the tool button drop down list to open the creation dialog.

 


Enter extension name, display name, name of main script file, author, date and description. Press OK when done. A new sub folder is created in the extension folder using the extension name above. The main file is also created and opened when you hit OK.


 

Note! Your main script file contain the function "ExitExtension()". This function is called by the editor to free added GUI objects, like added menu items.

 


Completion list

Press Ctrl+Space to open a completion list. This list contain default objects, classes and some functions you can use in your script. Class members may be displayed when you hit the dot (.) key.

 

E.g.

 

  TTimer tm = TTimer.Create(nil);

  tm.OnTimer = &OnTimer;


 

when you type "tm." and press dot(.) the TTimer members should be displayed.

 

This is also true for default objects.

 

E.g. Document.

 


Add and run the extension

Extension scripts are placed in a folder inside <AppData>\RJ TextEd\Extensions.


E.g.

 

<AppData>\RJ TextEd\Extensions\MyExtension\Script1.cpp


 

You can place as many files as you want inside your extension folder.

 

The created "info.ini" file contain the information given when you create a new extension. This file should also be included in the zip-file if you publish the extension.

 


Distribute the extension

You should pack (zip) your entire extension folder, including all script files and the "info.ini" file.


E.g.

 

..\MyExtension\

    info.ini

    MyScript1.cpp

    MyScript2.cpp


 

the info.ini file should contain the following lines


 

[MyExtension]

Name=My own cool extension

File=MyScript1.cpp

Author=Rickard Johansson

VersionString=2013-08-13

Description=Add some cool stuff to the menus.


 

Note that the name [MyExtension] and the folder name should be the same.

 

When creating the archive file you must use the extension folder name for the zip file.

 

"MyExtension.zip".


The extension can be uploaded to the "Extensions" forum, or sent to support@rj-texted.se.

 

Users will add the extension in "Addons -> Extensions". If found in the forum, use "Import from file..." and select the .zip file. The "MyExtension" folder will be created and all information from the "info.ini" file is imported.

 

 

 

 

 

 

 

 

 

Copyright © 2022 Rickard Johansson