Appendix E: JavaScript code snippets

CARTA provides an advanced feature for task automation - “Snippets”. To enable this feature, go to “File” -> “Preferences” -> “Global”. Once the “Enable code snippets” toggle is checked, a “Snippets” menu will appear in the menu bar.

To learn more about the code snippets, please refer to the tutorial and the API documentation. In principle, most of the actions you can do with the graphical user interface can be programmed into a code snippet.

With the snippet editor, you can write code, save it, and execute it. The saved code snippets will appear in the “Snippets” menu for future usage.

Tip

You may enable the browser’s console to explore the syntax and objects interactively.