Simplifying Filing: Move Selected Finder File to "Pick-A-Folder"

I see from “Move selected item to Documents, Pictures, or Music folder” posting that I can build a list of folders to move a selected file to via the conflict picker evoke by using the same hot key for multiple shortcuts. This is a good start, now:

Can KM display a set of folders, say all folders in the Documents folder or a list of folders (or alias of folders) I create in the Documents folder (or some other folder) that when I click on a folder within that set of displayed folders will move a previously selected file in the Finder to that folder and return me back to the folder I made the file selection from?

Keyboard Maestro can find all the folders in a directory. Displaying them as options is somewhat tricky, about the only good way would be using a Custom HTML Prompt which is non-trivial.

Possibly you could use something from this:

If you want to pick from a popup menu, that can be done with a simple Prompt For User Input action.

After that you use a Move action to move the file.

Hi BernSh,

This is a basic example.

The HTML prompt is a trimmed version from my Enhanced Screenshot Macro, also the JavaScript for menu building is the same (originally from here, credits to @ComplexPoint).

Note that this is a pretty simplistic example, no error checking etc.



Move Finder Selection to Folder.kmmacros (9.7 KB)


You can set your root folder in the first Set Variable action.

Peter,

I appreciate your time and attention. I started to unravel the “MACRO: Dynamic Prompt for User Input” and got as far as beginning to get my head around what a variable is and does. Then took a break. When I came back Tom pitched in and his “Move Finder Selection to Folder” macro actually does what I’m looking for requiring me to only set the root folder in the first variable action. This much I can do without doing the work of creating a new distinction. It includes a Custom HTML Prompt as you suggested and a JS step for good measure :wink:

This will work for now and I’ll be back if this breaks or need more. So much to learn “Small steps, Sparks. Small steps” :slight_smile:

1 Like

HI Tom,

Thank you for generously providing a simple workable solution to my request!

While it removes the need for me to go beyond what I already know, My guess is that it won’t be long before I run into my limited understanding and will be back to either learn more so I can feed myself or be treated to another delicious fish dinner :smiley_cat:

Thanks again!

3 Likes

The macro was not meant to be a solution, but rather something like a base to work on. The macro is far from being “finished” and I’m sure you can improve it without running “into your limited understanding”.

I would, for example, add a check wether a file with the same name already exists at the destination. (Otherwise the Move action will simply fail in such case.) You could then add a dialog (and the necessary actions) that gives you the possibility to reveal the offending file in the Finder.

Or… you could add another little prompt at the beginning of the macro that lets you select the root folder for the selection menu in the HTML prompt. And, because you don’t want to see that dialog on each run, then you could modify it so that the root folder prompt only pops up when the Option key is held down…

You see, plenty of —not too difficult— things to improve :slight_smile:

2 Likes

See if this simple macro will do what you need, or at least give you some good ideas. Note that it allows you to move one or more files and/or folders.

1 Like

Ok, this is getting more and more interesting. Nice to see the same outcome from different approaches. Very fortunate to study examples of an issue that I’m focused on. Ya’ll are really generous. Thank you!! Now to carve out some time to pick these apart to see how they work…

1 Like