Hi Chris,
Does something like this (VBScript) help?
IIRC, to get the name of the current routine that function must be called with the 'Current' parameter (i.e. GetScriptFileName('Current'))
'------------------------------------------------------------------------------- Function GetScriptFileName(ByVal CurrentScriptName) Dim Project_Name, ProjectRoutinesIteratorObject, _ ScriptRoutineObject, File_Name
GetScriptFileName = ""
' Get the name of the current project
Project_Name = ChangeFileExt(ExtractFileName(Project.FileName), "")
' Get the routines iterator of the current project
Set ProjectRoutinesIteratorObject = Sys.OleObject(_
"TestComplete.TestCompleteApplication", _
"").Integration.ProjectRoutinesIterator(Project_Name)
' Iterate through the list of routines to find the routine with the
' specified name
Call ProjectRoutinesIteratorObject.Reset()
While (ProjectRoutinesIteratorObject.HasNext())
Set ScriptRoutineObject = ProjectRoutinesIteratorObject.Next
If (CurrentScriptName = ScriptRoutineObject.Name) Then
File_Name = ScriptRoutineObject.ScriptFileName
End If
Wend
GetScriptFileName = File_Name
End Function
'-------------------------------------------------------------------------------