Navigation: For Developers > Extend Functionality with HEScript >

HEScript Script Editor





🎯 Using the HTML Executable Script Editor


✅ The Script Editor is your canvas for creating, removing, importing, and exporting HEScript scripts with the Script Manager.


✅ To dive into a script, simply select it in the Script Manager and click Edit. You can also double-click on the desired script for quick access. The script editor will also automatically appear when you import a script.


🚨 Alert: The script editor is your friend, but it's not foolproof. Just because a script is syntax-error-free doesn't mean it will work perfectly! Always test your ebooks and publications to ensure your scripts are functioning as expected!


Here's what the script editor looks like:



The script unfurls in the main edit box, ready for your modifications.


📚 Understanding the Behavior


✅ The script editor is smart - it automatically highlights the syntax. Pascal keywords stand out in bold, while comments take a backseat in italic.


✅ Feel free to modify the script as you see fit. To check for errors, click Check in the toolbar. This pre-compiles the script to catch any syntax errors, making it easy to spot and fix issues.


If the script is error-free, you'll see the message: "Script successfully compiled". If there's an error, you'll receive an error message with the reason and location in the source code:



The line containing the error will be marked in red:



Simply fix the problem and click Check again to clear the error.


✅ Once you're happy with your modifications, save the script by clicking Save. The script is first pre-compiled (as if you clicked Check) and if it's error-free, the editor closes and the script is saved. If an error is found, the script editor will stay open! If you want to close the editor without saving, click Discard.


For security reasons, only error-free scripts can be saved to the project. That's why scripts are pre-compiled when you click Save or when scripts are imported.


✅ The Help button is your gateway to these help topics.


📌 Further Reading


👉 Introduction to Scripting


👉 Script Function Reference