Welcome to the new forum. I can’t believe I’ve beaten Grant to the first reply . . . Sorry Grant
This script writes the full path of the input file(s) to c:\datapump\check.txt. You can just set a variable rather and chop it up rather than write it out if you like. But this was the easiest way I could think of testing it!
If you use StreamWriter, you’ll need to add system.io to the Imports section of the References and Imports tab.
Dim itemList As JobLogItemList
Dim item As JobLogItem
Dim n As Integer
Dim check as New Streamwriter("c:\datapump\check.txt")
Dim fullpath, fname(), ident as string
itemList = Log.GetInputItems(ProjectID)
'check to make sure there are import items (avoids an error)
If itemList.Count = 0 Then ' No input items exist
'do nothing as there are no input files
n = 0
'Loop through all input reports
For Each item In itemList
n = n + 1 'update the counter
'item.location returns full path e.g "c:\datapump\inbox\ABCname.txt"
fullpath = item.location
'Splits full path into separate components based on "\" and loads an array, so fname(0) = "c:\", fname(3) = "ABCname.txt" etc
fname = split(fullpath,"\",-1,0)
'extracts first 3 characters of 4th part of full path. NB Change fname(X) to required array element.
ident = left(fname(3),3)
check.writeline(fullpath & " " & fname(3) & " " & ident)
I'm sure there's a smart way to work out the last part of the fname array, but I couldn't put my finger in it.