Hi All,
I am trying to add a custom menu item into the TestStand >> Tools menu. This menu item should be accessible only during edit-time and not while any executions are running. I want the menu item to be enabled only on the condition that the directory in which the active sequence file is present should also contain an associated file with the same name as the sequence. I tried getting the Active sequence file path with Runstate.SequenceFile.Path and Runstate.InitialSelection.SequenceFile.Path expressions but the menu item is always disabled whenever I click on the Tools menu.
The entire expression that I use to check whether this associated file is available or not is this:
FindFile(SearchAndReplace((Split(RunState.SequenceFile.Path,"\\")[GetNumElements(Split(RunState.SequenceFile.Path,"\\"))-1]),".seq",".ini",0,False,-1,False,0),True,"",3,1,False,False)
Split(RunState.SequenceFile.Path,"\\") - Splits the entire path with \\ demiliter. The output of the function is an array.
Split(RunState.SequenceFile.Path,"\\")[GetNumElements(Split(RunState.SequenceFile.Path,"\\"))-1] - Splits the entire path with \\ delimiter, get the number of elements in this array and indexes the last element. The last element would give the name of the sequence.
SearchAndReplace((Split(RunState.SequenceFile.Path,"\\")[GetNumElements(Split(RunState.SequenceFile.Path,"\\"))-1]),".seq",".ini",0,False,-1,False,0) - Searches and replaces the .seq file extension with .ini extension.
Finally the Find File function searches for the ini file in the same directory as the sequence.
If I put this same expression in a Message popup and convert the result of FindFile to True/False, the result is displayed properly based on the sequence that I put this message popup into.
If the expression I have used is not correct, how should the expression be?
Thanks,
Saranya