Hey Yall I am at a loss and I am sure its a simple fix.
I want my prompt for user input to display all of the items currently selected by path finder.
Currently, its showing a prompt for each file selected
If I want to delete 4 files and I have 4 highlighted it will display a prompt for each file.
I would prefer 1 Prompt to list all 4 selected files.
I know my issue is that I have "For Each Item in a collection" I just can't figure out how to group them all together for 1 collection.
I have attached the Macro I discussed below.
Trash It Path Finder.kmmacros (31.8 KB)
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?
yes I am just stumped on how to get the list of all the selections in 1 prompt / will the delete action work for them all teh way it does on the loop?
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:
21)Trash It 1.1.kmmacros (30.5 KB)
Excellent Thank you for your help.
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?
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:
21)Trash It 1.2.kmmacros (32.0 KB)
My project for the day is to make this same workflow but for Finder!
You are awesome thank you so much!
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.
Trying to do the same thing for Selections in the Finder.
I am having 2 small issues
a " , (Insert File Name) keeps appearing int he prompt even with the filer
Its only displaying 1 file again.
I am SURE I am missing something silly but Ive been pulling my hair out for like 2 hours trying to figure this out.
Delete Item FInder Scratch.kmmacros (25.3 KB)
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":
Delete Item Finder Scratch 1.1.kmmacros (22.4 KB)
wow you are the best THANK YOU
@Brian_Martin, If one of the above posts solves your problem/question as originally stated, please check the "Solved" checkbox (click for details) at the bottom of that post.
Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.