Is there a way to have the script dialog box have the radio button that says "Close this dialog when completed successfully" unchecked for any user who runs the script tool? Is there configuration somewhere to do this? Thanks.

4 Answers
4

ArcGIS stores a great deal of a user's preferences in the Windows Registry, which is partially documented in "ArcGIS Desktop Advanced Settings Registry Keys.doc", found in the Utilities folder of your ArcGIS installation. You can browse these settings with the Registry Editor (run regedit), and look into the keys from HKEY_CURRENT_USER\Software\ESRI.

This particular feature asked in the question can be modified using Python (at your own risk!):

You can place snippets of this in def __init__(self) of the script validation, which runs before the toolbox progress dialog. However, if a user actually prefers to have the AutoClose checked, I'm not sure how to set it back after the script has finished, unless you store autoclose_before somewhere in the registry and do a similar post-set in your geoprocessing script. But you've been warned, this is Python hackery!

Based upon your comments in other responses, it sounds like you really just want to alert the user about things that have occurred during the operation of your script, rather than necessarily keep the script dialog box open.

A couple of alternative approaches could be:

Write the pertinent information back to the ArcGIS GP console by adding messages, warnings, and errors calls to your script. If the user simply unchecks the "Close this dialog when completed successfully", you pass all the info you want into the text box.

Write all the pertinent information to a log file. You could add a checkbox to your script to "View Log File" (checked on by default) that would open the log file after the process completes (to success or failure) using "os.startfile(your_log_file)", which would open the log file in it's default application.

A clean, no fuss alternative would be to display your log file in a simple Tkinter window at the end of your script. While the registry option is workable, there may be forces beyond your control, admin privileges, etc.

Is there some other way to get info about the script run to the user that would stay open past the run of the script. The issue is that I have vital info about what was found and more importantly what was not found on long running scripts. So the user usually kicks it off at night then when back to the computer the dialog is gone. win32gui didn't work too well because I had to go around installing it on users computers(if I was doing it right). Thanks.
–
JustinJan 26 '12 at 2:03

The usual method for long running tasks would be to write the pertinent info to a log file. Its much cleaner than using the geoprocessing window.
–
tharenJan 26 '12 at 10:03

I have the info in logging but then how would I dialog back to the user to go to the log file in a clean and polished manner? I could have the user enter his email address and email them but this seems to intrusive.
–
JustinJan 26 '12 at 13:44

2

Dan, with software often "not possible" is not a hard and fast characterization: there may be clever workarounds or options for dedicated savvy programmers. I'm not asking you to elaborate on just how impossible this is, but would you be able to supply a reference or some evidence of the impossibility?
–
whuber♦Jan 26 '12 at 14:33