Access Astah models via scripting languages to perform what Astah’s standard functionality does not offer.
If you are using Astah System Safety, please read this page for how to use the Script Editor and sample scripts.
If you are using Astah Pro 7.2 or later, the script editor is included already, so skip to “How to use”.
You can find script samples on Sample Scripts page.
Also, if you download the plug-in files from the [Download] button at the top of this page, you will get the following sample .js files.
|addSetterGetter||Add Setter/Getter to target Attributes|
|addStereotypeToSelectedModel.js||Add stereotype to target models|
|checkEdition.js||Show the version of currently-used Astah|
|countClasses.js||Show a number of Classes that are included in the currently-open project|
|createAndOpenDiagram.js||Create a new Class diagram|
|createEREntities.js||Create new ER entities with specific logical names and physical namess|
|exportCsv.js||Export model information to CSV format file|
|printClasses.js||List up all the Class names in the currently-open diagram|
|printERIndex||List up all the Index information of all the ER models|
|printMindmapTopics.js||List up all the topics in currently-open Mind Map|
|printPackageAndClassInfo.js||List up all the package and class names|
|printPresentationProperties.js||List up all the property information of target model element|
|searchAndEdit.js||Search a class by keyword and add a specific color and note to it|
|searchMessagesWithoutOperation.js||List up all the Messages without operations in Sequence diagrams|
|useJavaGUI.js||Open a dialog to enable you to use Java GUI|
Sample scripts may not work on old version of Astah. If you are using Astah Pro 6.9 or earlier, use the sample scripts in the [sample scripts] – [java7] folder. Also some somple scripts do not work with Astah Community because it does not provide support edit API.
|projectAccessor||projectAccessor object in Astah API. null means there is no project file in Astah.|
|astah||same as projectAccessor|
|astahWindow||Main window of Astah|
|scriptWindow||Window object of the Script Editor|
You can use other scripting language for this Script Editor if you have OSGi bundle and JSR223 jar files.