Macros gets the information of the read file

I want to use the macros script to do the same processing for all the read in files. How can I get information from the tree of the pipline browser when I’m not sure about the contents of the file

As shown in the figure, how to make different files perform the same operation.