Select to view content in your preferred language

toolbox not using updated script

1241
4
12-08-2011 07:23 AM
JasonMills
New Contributor III
I have a tool using a python script I wrote. I made some changes to the script, but the toolbox tool is not seeing the updated script. Does tool box cache the old scripts somewhere?
I made the tool on my PC and script on my PC, then copied the script to a shared server to which everyone has access. I then copied the tool to a tool box stored in our SDE server. The tool in SDE runs, but it runs an old copy of the script. Any idea on how to fix this?
Tags (2)
0 Kudos
4 Replies
StephanieWendel
Esri Contributor
Each script tool references a particular script that the tool is based on. If you made a copy and did not change the script tool's source when absolute paths are used then it would still reference the old script. You might also have some reference problems if using relative paths as the storage type and not placing the new script in the right location.

You can always adjust the location the script tool references by right clicking on the script tool and selecting Properties. Click on the Source tab and change it to the correct script file path.

Another thing you might want to consider is embedding the script file into the toolbox. You can then directly edit the script in the toolbox and whenever this toolbox is shared, the script will be shared with it. This will also allow you to password protect the original script so that you can manage who can make changes. See this help document for more information on setting this up: Embedding scripts and password protecting tools.
0 Kudos
JasonMills
New Contributor III
When I noticed the problem yesterday, I checked the script on the shared server to make sure that the updated script was in the right place. The source of the tool in the toolbox on SDE was pointed to the right location, but I reopened the source again hoping it would fix the tool. It didn't. The tool would not run the updated scrip for whatever reason.
0 Kudos
JamesHook
Deactivated User
I have had this problem too, but been able to fix it simply by rebooting ArcMap.  Don't know what to tell you.
0 Kudos
JasonMills
New Contributor III
It's annoying, because it worked great in the past. It seems like something has changed with the last service pack for ArcGIS 10. I ended up embedding the script in the tool. I'll just have to remember to make the changes in two places. Oh well.
0 Kudos