[FINDER] Move Selected Finder Items to Choose Folder [Example]

example
files_folders
finder

#1

MACRO:   [FINDER] Move Selected Finder Items to Choose Folder [Example]

2017-02-11 12:10 CT

  • Add better error handling
  • Add prefix of “MSF__” to all KM Variables used in this macro
    (all variables are deleted at end of macro)

~~~ VER: 1.1    2017-02-11 ~~~

DOWNLOAD:

[FINDER] Move Selected Finder Items to Choose Folder [Example].kmmacros (21 KB)


ReleaseNotes

Author: @JMichaelTX

PURPOSE: MOVE Items in Finder Selection to Destination Folder Chosen by User

HOW To USE:

  1. Select one or more items (files and/or folders) in the Finder
  2. Trigger this Macro
  3. MOVE will be CANCELED if the User cancels the Choose Folder script, OR clicks on “Stop” in the “Confirm Move” alert.

Note that the App focus starts on the Finder, and remains the same after the macro completes.

BASED ON THIS USER QUESTION:

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?

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

REQUIRES:
(1) Keyboard Maestro Ver 7.0.3+
(2) Yosemite (10.10.5)+



Example Results


Move Selected Finder Item(s) to folder?
Move selected item to Documents, Pictures, or Music folder
Clean Desktop
Simplifying Filing: Move Selected Finder File to "Pick-A-Folder"
Help please - Need a simple "Move to Folder" macro
Easiest solution to move selected file in Finder to another folder?
Easiest solution to move selected file in Finder to another folder?
Best Macro List
#2

Hi @JMichaelTX

I get a strange result here

The variable DestinationFolder is getting set to that location in /Library inside theSCRIPT: Choose DESTINATION Folder script. If I extract that script and run it in Script Debugger, I don’t get this result. I’m not using DestinationFolder in any other macro, and even when I add an action to Set Variable 'DestinationFolder' to Text' (setting it to an empty string), I still get the weird result. Something is going on with the script in the action but I haven’t been able to isolate it.

I’ve left ParentFolder set to ~/Documents which is fine for me. That bit is working OK.

I’ve rebooted several times, and get the same result. Not sure why iMindMap’s QuickLook generator has anything to do with anything here, and I’ve definitely never grabbed its file:// path for any reason.

I’m sure it’s something very obvious that I’m fat fingering or ignoring :frown:


#3

What folder are you choosing for the Destination Folder?
I need this so I can test.

Is this happening for all choices of Destination Folder?


#4

Hey @JMichaelTX

Thanks for replying. I’m using ~/Desktop and subfolders of ~/Documents. If I extract your script “Choose DESTINATION Folder” entirely and run it in Script Debugger I have no errors. For example, the value returned in destinationFolder is ~/Desktop, or whatever I choose in the dialog. I don’t know if that’s useful info.


#5

Just updated the macro in the above post.

@korm, please download and try the updated macro.
The KM Variable “DestinationFolder” is now named “MSF__DestinationFolder”.
Perhaps there was some conflict with the original name.

Please let me know if this fixes your issue.


#6

Hey @JMichaelTX – it does fix it. Thanks so much for your help. I like this macro.

Next thing I plan to do is extend the macro to grab the lists of Favorites and Recent destinations from Default Folder X and optionally offer them as destinations for your move macro. I’ll post my update whenever I have a chance to do those mods.

(Sorry I cannot mark your reply as a solution – since I’m not the OP in this thread – but kudos anyway :smile:)


#7

That sounds great!
I suggest that you post it as a new topic in the “macro” section, with a link back to here.
That will help others find your macro easier.


#8

Great macro! I’ve posted it here: https://cafetran.freshdesk.com/support/discussions/topics/6000051701

I have a lot of project folders and it can take some mouse actions to scroll down to the right one. Would it be possible to add an incremental search for the project folder name? E.g. I start typing m,u,e to have the project folder mueller selected? Or would that require a full blown app? ;).

Anyway, many thanks for this nice macro.

I just had an idea: When I switch the View mode to the List display instead of the [||_] one (don’t know what it’s called), then the problem is solved. So I’ll google for how to switch to this List display ;).

It’s at easy as using this AppleScript:

tell application “Finder” to ¬
set the current view of the front Finder window to list view


#9

Is this what you are looking for?
KM can perform Applescripts


#10

A good solution for this is to make a set of macros with the same trigger, each of which moves the files to a specific folder. Then Keyboard Maestro will use the Conflict Palette to let you select the desired folder.

I have this set up on Control-F in the Finder:

Pressing S would eliminate all the others and let me choose an account with C/M/S.


#12

I've got a huge folder of PDF books that I want to organize. To start with I want to categorize the books into big folders like FRENCH, MATHEMATICS, and so on. So far, those aare the only two I've tried.

I changed this action to hard-code the destination folder to either FRENCH or MATHEMATICS, based on whether I press one key chord or another.

For some reason, to move five or six files, this action takes fifteen to twenty seconds.

The only non-standard thing I'm coping with is that the files are in a Dropbox folder that I have mounted using an app called Cloud Mounter. So my destination folder looks like:

~/Library/Containers/com.eltima.cloudmounter.mas/Data/.CMVolumes/Dropbox/Books/Math

Still -- seems like I could just open a few windows and drag and drop if each small set of files is going to take so long to move.

What might I be doing wrong?


#13

This is very unusual. I've moved lots (>50) files with this and it is fast.
But maybe there is something with your setup/use case that is much different.

To analyze, we need more info:

  1. If you manually move the same group of files, how long does it take?
  2. How large are these PDF files?
  3. Have you tried moving to a non-Dropbox location?