Read path text from file and pass it to parameter to check file details

need a little syntax help here.
This is in a action script.
trying to read a text file that has a path in it and pass that out to parameter, so I can get the file details and output that to a text file.
The first line “parameter CTX” works fine, the second line “Parameter FileDetails” does not work and I get an error “relevance clauses must be surrounded by { and } guards” but I do have the guards, so I am not sure what the syntax issue is??
also how would I get the value of parameter “FileDetails” output to a text file? I have tried this parameter “FileDetails” >> c:\temp\FileDetails.txt
but that did not work.
thank you for helping.

parameter “CTX” = "{following texts of firsts “Location:” of lines whose (it contains “Location:”) of file (“C:\temp\PythonCTX.txt”)}"
parameter “FileDetails” = {(creation time of it, modification time of it, size of it, sha1 of it) of files parameter “CTX” & “\ctx.py”}

In the Fixlet Debugger you may get that for any substitution error.

Without parentheses, this would try to append the string “\ctx.py” to the file "parameter “CTX”, and appending a string to a file object is invalid. I think it’s just a matter of parentheses to append the string to the filename before trying to open it

parameter "FileDetails" = {(creation time of it, modification time of it, size of it, sha1 of it) of files (parameter "CTX" & "\ctx.py")}

You can also have a problem though with how you’re using the parameters to begin with - if there are multiple matching paths in the file, the results are all crammed together like “C:\path1C:\path2”.

Probably better to just have an Analysis that returns multiple results, with the details for each, instead of trying to put them all together in a single parameter.

For an Analysis Property, you might use the relevance

(pathname of it, creation time of it, modification time of it, size of it, sha1 of it) of files ((it as trimmed string & "\ctx.py") of (following texts of firsts "Location:" of lines of file ("C:\temp\PythonCTX.txt")))
1 Like

thank you very much Jason! this did the trick!

1 Like