lgtateos

Get script path from ToolValidator

Discussion created by lgtateos on Apr 12, 2014
Latest reply on Apr 13, 2014 by Caleb1987
Hi All,

From inside the ToolValidator in a script tool, is there a way to determine the path of the script to which a script tool is pointing? 

I'd like to set the default value of an input data file based on its relative path to the script.   An acceptable alternative for me would be to detect the location of the toolbox containing the script tool.  But the following return empty strings inside the ToolValidator class:

os.getcwd
sys.argv[0]
os.path.abspath(__file__)
inspect.getfile(inspect.currentframe())


Thanks!

Outcomes