If you are using a loop to go though each file in a list, then by necessity you are going to have as many prompt windows as you have files.
If you replace it by a single Prompt action then you can list all the files inside the Prompt action.
So I think what you have to do is forget about the loop. You want a single prompt which lists all the files in the prompt box followed by an action that deletes all the files.
Does that make sense? Do you need advice on writing that code?
The script your macro uses is already returning a list of selected files in the variable Local__PFSelection, so @Sleepy is right; you don't need the For Each loop at all. All you have to do is include that variable in the prompt:
The filter action removed the file location and just gave me the file names, but only seems to work with the first file selected, any way to make ti include them all?
If you are talking about your Javascript code, I can't help. I never learned Javascript. If you are talking about KM, then tell me what filter you are talking about. I don't see a filter. All I see is a Prompt action and a Type action.
If your Javascript code is intended to get the names of the selected files, and that code isn't working, why not try the very easy method that KM provides you:
This code will place all the names of all the selected files into a variable. But for me this is about 25 times easier to understand than Javascript. Make sure you include a carriage return after the variable name in this example.
Ah, now I see what you were trying to do with the loop. Yes, for this, you do need the For Each action. Basically, the only steps you were missing were appending the filter results to a new variable, and putting the prompt in its own action after the loop rather than inside it. I believe this should do the trick:
@Sleepy
The OP can't use that method (which I also personally prefer) because he's trying to do this with Path Finder. I know almost nothing about JavaScript too, but that purpose is explicitly written in the script's comments:
I try to be brave and help people even when they are talking about things that I don't know much about. Sometimes it works, sometimes it doesn't. In this case (if) the requirement was to get KM to work with his Javascript code - then I'm out of my league here.
GG is one of the elites here, I'm glad he could help. I'm sorry my advice wasn't as good as his. My name is "Sleepy" for a reason: I'm not as sharp as the experts here.
No problem. For the Finder, you don't need a script to get a list of every file path selected. KM's Finder Selection collection can be used directly with the For Each loop without any extra steps. All you need to do is erase or disable the script action here and change the For Each collection to "Finder's selection":