pschneider

Ensure ArcMap is open before opening script tool

Discussion created by pschneider on May 9, 2011
Latest reply on May 12, 2011 by achapkowski-esristaff
I've got a script tool that utilizes the "CURRENT" mxd as a parameter.  What initialization code could I use in the validation code to ensure that an mxd is open?  In other words, prevent it from being run in ArcCatalog...

Taken from MapDocument Help Documentation:

Script tools that use the CURRENT keyword must be run from within ArcMap (either from a custom menu or the Catalog window). Script tools using CURRENT will not execute properly if run from within the ArcCatalog application. For this same reason, if a script tool has a validation script that includes a reference to CURRENT, an error may occur if you try to edit the validation script from ArcCatalog. Be sure to edit the script tool's validation code from within the ArcMap Catalog window.

Outcomes