I am using a Python script tool within an ArcToolbox in ArcGIS 10.2.

The script calls another python script tool while running but does not display the messages from the called script when using the arcpy.AddMessage() method.


scribtbox (ArcToolbox) two script tools

  • script1
  • script2


import arcpy

# output to the screen
arcpy.AddMessage("Doing routine 1...")

# call script2


import arcpy

# output to the screen
arcpy.AddMessage("Doing routine 2...")

The output model run dialog box in ArcGIS says:

> Doing routine 1...

and then finishes without saying the message from script2.

I'd like it to say:

> Doing routine 1...
> Doing routine 2...

and then finish.

Is this functionality not built in, am I doing something wrong, or is there some other issue at hand.

  • 2
    Why not just import script2 in script1 and call a method?
    – Nathan W
    Jan 21, 2014 at 23:15
  • 1
    @NathanW one reason might be if you have a customized ToolValidator class in the script tool definition, it is automatically ran when called as such.
    – blah238
    Jan 22, 2014 at 0:58

1 Answer 1


When you call a script tool it behaves just like any other geoprocessing tool you call from Python. No messages are automatically added to the console (unless there is an unhandled exception).

What you want to do is use arcpy.GetMessages() and arcpy.AddMessage, AddWarning, AddError, etc. after calling the script tool as described in the help.

  • 1
    You might be able to return a message at the end of the second script back to the first one - but I agree with blah238 - I don't think there is away to write them out in process.
    – dklassen
    Jan 21, 2014 at 23:20
  • I am using arcpy.AddMessage() to add my own custom message so the 'run dialog box' will keep me updated of where the script is at. Adding my own messages in this fashion 'does' add messages automatically to the console. At least it does for the main script (the one that I run from the toolbox manually) but not for the script that is called within the main script. As @dklassen said, arcpy.GetMessages() might be able to return the custom messages from script2 but it would likely print them all after the run, not in process. Perhaps this is just not built in functionality.
    – Chaz
    Jan 22, 2014 at 16:01
  • 4
    It is not, at least not in arcpy. In ArcObjects I believe there are is an interface with a callback (IGPMessages) to get messages as soon as they are created, but AFAIK this is not exposed in arcpy.
    – blah238
    Jan 22, 2014 at 16:14
  • How would one achieve this functionality if, for instance, script2 was a standalone script and not a script tool?
    – Barbarossa
    Mar 8, 2023 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.