The SaveTools event is called when Scorpion saves the toolbox Example:
Saving tool to separate files
def Handle_System_SaveTools(Path):
#
# Path = VT_BSTR
#
# Return 1 if handled by script
# Return 0 if default handling
#
import os
Path=Path+'\\tools\\'
tools=GetToolList()
f=file(Path+'index.txt','w')
for i in range (tools.count):
t=tools.tool(i)
f.write('"%s","%s"\n' % (t.type,t.name))
filename=Path+t.name+'.spb'
if 0: t.save(filename) #set to 0/1 to save tools
f.close()
return 1
|