17 Automation and IDEAScript

Automation and IDEAScript

IDEASCRIPT IS A PROGRAMMING tool in IDEA that allows for combining numerous steps into a single procedure. The programming language is similar to that of Microsoft’s Visual Basic for Applications. IDEAScript files are also known as macro files. It is a file that performs a series of actions when executed. IDEAScript can record actions for editing and modification to make the macro good for general use— any user can apply the script to any suitable data files. IDEAScript is a powerful tool that speeds up repetitive procedures.

IDEAScript can be used for:

  • Automating repetitive tasks. Regular tasks, such as monthly data that needs to be analyzed, can use IDEAScript to run and repeat the required procedures automatically. IDEAScript can be efficiently used when certain procedures are required to be applied in multiple locations such as departments, divisions, and branches. Another frequent repetitive task is to import files. This can be automated to select the input files, specify the output names, perform the imports, and perform required data cleanup or scrubbing.
  • Creating an automated-analysis system. A set of tests or procedures can be integrated into an IDEAScript where the user may select particular tests to apply.
  • Controlling other software packages. Using Microsoft’s object linking and embedding (OLE) technology, other OLE-enabled software can be controlled from within IDEA. One example is that of sending IDEA data into an Excel spreadsheet. IDEAScript performs analysis tasks such as summarization, sends the summarized data into an Excel spreadsheet, and then the IDEAScript instructs Excel to chart the summarized data into bar graphs.
  • Creating custom tests. IDEAScript can be used to create specific tests based on the user’s or the organization’s needs. Typically, these would be performing calculations that involve comparisons and equations.

In using IDEAScript, work will be performed faster and the results will contain fewer errors. The analyses are done more consistently and can be undertaken by other staff members. Standards are adhered to by all users.


The following steps should be considered when planning to create an IDEAScript.

  • Identify those tasks that are frequently repeated. The more often the procedures need to be repeated, the better suited they are to invest the time to create the IDEAScript.
  • Select those procedures that are well defined and well understood. It is likely that the user understands the task well, as he or she has performed the procedures often.
  • Plan the macros carefully to ensure the results are those expected.
  • Include user-input dialog boxes so that others can use the IDEAScript. Investing some additional work to make the script as flexible as possible so it is useful to others increases the value of the script.
  • Plan to test the IDEAScript on other computers with different versions of IDEA for compatibility and to ensure that the script works as expected.

Visual Script versus IDEAScript

Visual Script can create and edit macros in IDEA. Visual Script is a visual representation of batch processing that allows for simple dragging (or double clicks) of desired action choices from the left side of the window to the right side for project steps of the Visual Script screen, as shown in Figure 17.1.


Figure 17.1 Visual Script Editor Window

Visual Script, like IDEAScript, allows for automation of repetitive tasks. However, the automation can be performed without the complexity of knowing any programming and writing code. While easier to use, there are limitations, such as not being able to create message boxes, nor will Visual Script run in the IDEA Server environment. Visual Scripts have the .vscript filename extension and are saved to the default Macros .ILB folder under the active project folder.

Visual Scripts can be later converted to IDEAScripts, if desired, through an option in the Visual Script Editor. Because of the easy conversion to IDEAScript, you can start the steps for your macro in Visual Script, convert it to IDEAScript, and then code additional functionalities within the IDEAScript editor. Visual Script has the ability to include IDEAScripts into it. This makes it simple to group together a number of IDEAScripts and have Visual Script run them all. Visual Script is an excellent personal tool.

IDEAScript is much more powerful than Visual Script. Because of its power, it is rich in abilities that allow flexibility in creating macros. IDEAScript can use dialog boxes, control other software applications, and interact with the operating system. An example of the IDEAScript editor window with a sample script is shown in Figure 17.2


Figure 17.2 IDEAScript Editor Window

IDEAScripts can be saved in three different formats designated by the filename extension. Each format has its own unique advantage.

  • iss: This is the default format. The coding is open and allows any user to view it and to modify the script as they wish. The script can only be executed from within IDEA or from the IDEAScript Editor.
  • ise: This is the compiled version of the script. As it is compiled, the coding cannot be seen nor can any changes be made to the script. Changes can only be made in the iss file, which then has to be compiled again. This format is good for distribution to ensure that nothing is inadvertently changed or if you wish to protect your code. The ise file can only be executed from within IDEA.
  • exe: This format is similar in properties to that of the ise format with the exception that it is compiled as a Windows executable file. IDEA does not have to be opened to run the file. However, IDEA must be installed for the script to work.


This book does not go into the details of programming IDEAScripts. The purpose is to provide an overview of both the simplicities of creating basic scripts and the complexities of creating scripts with user interface dialog boxes and performing intricate procedures. Complex scripts are included in this book’s companion website. While complex scripts may have thousands of lines of code, the one in Figure 17.3 has merely 11 lines.


Figure 17.3 IDEAScript to Rename a File

The script in Figure 17.3

Only gold members can continue reading. Log In or Register to continue