Move Files Selected in Finder to Specified Folder [Example] Macro (v9.0.3)

MACRO:  Move Files Selected in the Finder to a Specified Folder [Example]


VERSION: 1.0 – 2019-03-20


Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Move Files Selected in Finder to Specified Folder [Example].kmmacros

Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Move Finder Selection to Destination Folder

REQUIRES:

  1. KM 8.0.2+
  2. macOS 10.11.6 (El Capitan)

NOTICE: This macro/script is just an Example

  • It has had very limited testing.
  • You need to test further before using in a production environment.
  • It does not have extensive error checking/handling.
  • It may not be complete. It is provided as an example to show you one approach to solving a problem.

How To Use

  1. First, follow instructions in Macro Setup section below.
  2. Select one or more files in Finder to be moved.
  3. Trigger this macro.

MACRO SETUP

  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me. ??
  1. Assign a Trigger to this maro..
  2. Move this macro to a Macro Group that is only Active when you need this Macro. This is probably the Finder Group
  3. ENABLE this Macro.
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    (all shown in the magenta color)
    • SET to Full Path of Destination Folder

TAGS: @Finder @Move @Files

USER SETTINGS:

  • Any Action in magenta color is designed to be changed by end-user

ACTION COLOR CODES

  • To facilitate the reading, customizing, and maintenance of this macro,
    key Actions are colored as follows:
  • GREEN -- Key Comments designed to highlight main sections of macro
  • MAGENTA -- Actions designed to be customized by user
  • YELLOW -- Primary Actions (usually the main purpose of the macro)
  • ORANGE -- Actions that permanently destroy Variables or Clipboards,
    OR IF/THEN and PAUSE Actions

USE AT YOUR OWN RISK

  • While I have given this limited testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
  • If you have any doubts or questions:
    • Ask first
    • Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.

1 Like

This looks to be exactly what I need, but it only seems to work with files selected in Finder or on the desktop (Finder again), I'm looking to get it working with Forklift.

I have put the Macro in a new group which is defined as operating for Finder, Forklift and PathFinder (I.e. all my file managers).

Any ideas?

I googled "forklift" and it appears to be an FTP client for macOS.

File names in an FTP client can either be names of files that are on a remote server, or names of files that have been downloaded into a folder on your local drive after being downloaded. If the former, I don't think there's any chance KM can do what you want here, because the files have to be downloaded first before the action you are using can manipulate/move them. But if the latter, there may be a chance. We may have to delve into AppleScript using your app. Since I don't have forklift, I can't delve.

I'm not an admin on this website, but I recommend that an admin migrate this question to another thread, because it's not really a question about Michael's macro. It's a question about getting similar functionality for a specific program.

Forklift can be a FTP file manager but I use it 99% of the time locally to move files around and do all file management on my Mac. It fills so many gaps that exist in Finder.

Quite happy for an Admin to move it if needed.

So in my opinion the best way to deal with your question is to find out if Forklift has support/hooks for AppleScript. If it does, then AppleScript can probably obtain the names of the selected files and allow you to process them in a KM AppleScript action.

However there is an alternative. If you can precisely document a mouse and keyboard solution to your problem, we could get KM to use its mouse and keyboard actions to solve the problem without AppleScript. That's usually very tricky and sometimes has lower reliability. Personally, I love this approach, but since I don't have that app, I can't even start with it.

If you open the macOS app called Script Editor and use that app to open the Forklift app, you can browse its support for AppleScript. If you see properties with names something like "List of Selected Files" then that's a good clue that it supports AppleScript.

Understood from what I can see it looks like Forklift does not support AppleScript. I've put the problem to the guys on the MacScriptor forum to see if they can come up with any ideas.

I'll skip using the mouse and keyboard actions approach as that does indeed seem rather less elegant.

Hey Daron,

ForkLift is just barely AppleScriptable, and it does not have the capability of getting the selection via AppleScript.

However – you can copy the POSIX Paths of the selected items and go-to-town.

Grab the paths from the clipboard and process them as you see fit with either AppleScript or Keyboard Maestro native actions.

Please take the time to complain to BinaryNights Software about their lack of AppleScript support.

At the very least you should be able to get and set the selected items.

The best you can currently do is reveal an item.

-Chris

Thanks guys I'll give up on it then, it was just a nice to have instead of dragging / dropping :slight_smile:

Fair enough. But now that you mention you can do it with dragging and dropping, my earlier point may merit more muster, when I said, "If you can precisely document a mouse and keyboard solution to your problem, we could get KM to use its mouse and keyboard actions to solve the problem without AppleScript." In other words, if you can precisely describe how you do it with the GUI, it's probably possible to do the same thing with KM which can use the same GUI.

Yep understood, but as I can be changing windows, tabs, etc it'd be a nightmare to handle in that manner.

Hey Daron,

Did you misunderstand?

You actually can do this with ForkLift – it's just not an organic process.

  • ForkLift can copy the paths of the selected items to the Clipboard.
  • From there you can process them as you like.
  • Change @JMichaelTX's For/Each to operate with lines on the Clipboard, and you're good to go.

-Chris

Ah ha I did misunderstand I'll see if I can make the modifications to the Macro. Cheers

1 Like