Admin Script Editor 3.2 Send comments on this topic.
Saving and Updating Forms
Welcome to Admin Script Editor v3.2 > Features > ScriptForm Designer (SFD) > Saving and Updating Forms

Glossary Item Box

When you "Save to ASE", ScriptForm Designer inserts your form code into the active script document. If a supported script file is not selected in ASE you will not be able to perform this action. To see if ASE is ready to receive the code from SFD look to the status bar for the notice "ASE is Ready".

ASE is ready

SFD Code Regions

When code is inserted, it is broken up into a few different regions explained here:

For readability, the following regions are all included in one parent region named "ScriptForm Designer"

Constructor

This code area is designed to establish the object used for form creation. This may be either the assignment of a variable to the KiXforms or KiXforms.NET object, or for PowerShell native forms, the calls to the .NET windows Forms assemblies are made.

This area is created when SFD initially inserts code into ASE, but is not updated again in subsequent insertions. Therefore, you may edit this region and it will not be overwritten in the future.

Post-Constructor Custom Code

This code area is intended to provide a place where you may include custom code before the form creation code which will not be updated by SFD. You may edit this region and it will not be overwritten by SFD in the future.

Form Creation

This is the code area written in by SFD that builds the form created in the designer.

ASE does not support manual editing of this region!

This area is overwritten each time a "save" operation is initiated from SFD. Changes to this area may be lost and may result in the inability of SFD to load a created form. Any changes desired here should be either made within SFD or variables may be reassigned or changed in the following "Custom Code" region.

Custom Code

Any form code updates you wish to make should be placed here (if not made within SFD directly). This region is not overwritten by SFD and may be edited without fear of modification by SFD in the future.

Event Loop

This region contains the event loop used to display the form and wait for actions made by the script user. Like the Constructor region, this area is created when SFD initially inserts code into ASE, but is not updated again in subsequent insertions. Therefore, you may edit this region and it will not be overwritten in the future.

 

Following this "ScriptForm Designer" region is one more named "Event Handlers". This area is intended to be where your functions are placed. If a function is assigned to an event in SFD, a blank function block for that function will be created in this region automatically which you may then update. This area is not overwritten, but is added to if ASE finds functions referenced in SFD that are not already included.

 

Note: for PowerShell the "Main" command must remain at the very bottom of any included functions you place in your script in order to be properly addressed by any specified events.

Opening A Form For Editing

To open or update a form, you may either have the script with the form as the active document when you launch SFD, or you may simply use SFD: Menubar.