A quick tour of creating script tools

Scripts that you create can be executed with one of two basic methods: outside ArcGIS and within ArcGIS.

Creating a script tool for your script is easy, and there are many advantages to doing so.

To create a script tool, you need three things:

To create a script tool, right-click your custom toolbox and click Add > Script. This opens the Add Script wizard that takes you step by step through the process of creating a script tool. After completing the steps, your toolbox will contain a new script tool. You can always modify properties (such as parameter names and data types) of this script tool by right-clicking the script tool and choosing Properties.

The table below guides you to topics that show you how to create script tools.

Creating a custom toolbox

This topic shows you how to create a custom toolbox to contain your script tool.

Understanding script tool parameters

The parameters of your script tool need to be precisely defined. This topic is all about how you define parameters.

Adding a script tool

This topic explains the Add Script wizard and what it requires.

Editing script tool code

This topic describes how to open your script for editing.

Debugging script tools

This topic explains how to debug your script tool.

Setting script tool parameters

This topic is all about defining and setting parameters.

Writing messages in script tools

Because your script will be executed from an ArcGIS application, such as ArcMap or ArcCatalog, you can write messages to the progress dialog box.

Running a script in process

You can make your script tools run faster by running them in process. This topic describes in-process execution.

Customizing script tool behavior

Programming a ToolValidator class

Debugging a ToolValidator class

You can customize how your script tool dialog box appearance changes based on user input. For example, you can enable parameters, provide default values, and restrict parameter values to be only certain types (for example, only allow point feature classes to be input). You can also define properties of your tool output for use in ModelBuilder. These three topics show you how this is done using a special Python class called ToolValidator.

Setting output symbology in scripts

You can associate a layer file (.lyr) with an output parameter to define the symbology used to display the output. This topic shows you how this is done from a script.

Embedding scripts and password protecting tools

Rather than having a separate script file on disk, you can embed your script with the tool. You can also protect your script from viewing by using a password.