Compressing the OpenScript code generated by the Actions Editor

Actions Editor ››

Background

When you create an Actions Editor sequence on a button object, such as:



and then exit the Actions Editor, ToolBook will automatically generate the equivalent logic written in OpenScript code (which is needed in order for your Actions Editor logic to function in Native ToolBook) and stores that OpenScript code in the Script of the button.



Notice that it takes a lot more OpenScript code to represent the same logic you've written in the Actions Editor. Much of the OpenScript logic is Error-Checking code. However some of the logic is simply comment lines (which serves no functional purpose) such as:


 -- WARNING: This handler was created by the Actions system. Do not remove or modify it.


Because the OpenScript logic is more verbose than the Actions Editor logic, it is possible to write so much code in the Actions Editor for a particular object, that it overflows the limit imposed on the size of OpenScript code permitted in an individual object. That limit is currently 64K (65,535 characters of OpenScript).


Problem Areas


Solution

Since ToolBook does not really need the comment lines in order to function, getting rid of those comment lines could permit more Actions Editor code to be added to an object.


In order to tell ToolBook to not generate those comment lines, thus compressing the code a bit, do the following:


  1. From the Tools menu choose LiveXtensions
  2. In the LiveXtensions, click the Devex tab
  3. Locate the Tool named Actions Editor Compression, and double-click it
  4. The Actions Editor Compression tool will allow you to enable Actions Editor compression.


Once you have enabled the Actions Editor Compression feature, any new Actions Editor code that you write in this particular book will be created with compressed OpenScirpt code.

What about old code.....code you've already written?

If you wish to compress some Actions Editor code which has already been written (for example, the button logic used in sample above), do the following:



The compressed version of the OpenScript in this example (without the comment lines) would look like:




KEYWORDS: large overflow stack too 20481 P745




Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites