Transfer Files Between Folders [Example]

MACRO:   Transfer Files Between Folders [Example]

~~~ VER: 2.0    2018-03-12 ~~~

DOWNLOAD:

Transfer Files Between Folders [Example].kmmacros (41 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.

Please feel free to post below with any questions/issues/suggestions.


This Macro Provides

  1. Selection of Source and Destination Folders
  2. Folders can have default selection based on selection in Finder
  3. Prompt to Confirm continue of macro, showing folders
  4. Files with same name in Destination folder will be overwritten, but sent to macOS Trash.
  5. Log of Results

Example Output

Before Trigger, Select SOURCE Folder

2018-03-12_23-04-39

Prompt for SOURCE Folder

(folder can be any name/location)
2018-03-12_23-05-29

There will be a similar prompt for DESTINATION (TO) Folder

CONFIRM Continue of Macro with Folders

2018-03-12_23-01-09 (2)

Log of Results

2018-03-12_23-01-09 (3)

Reveal Finder Destination Folder

2018-03-12_23-01-10


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Transfer Files Between Folders
    • Existing Files in Destintion Folder will be overwritten.
    • Original file sent to macOS Trash.

REQUIRES:

  1. KM 8.0.2+
  • But it can be written in KM 7.3.1+
  • It is KM8 specific just because some of the Actions have changed to make things simpler, but equivalent Actions are available in KM 7.3.1.
    .
  1. macOS 10.11.6 (El Capitan)
  • KM 8 Requires Yosemite or later, so this macro will probably run on Yosemite, but I make no guarantees. :wink:

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. Select for SOURCE folder in the Finder.
  2. Trigger this macro.
  3. Select/Choose Source/From Folder
  4. Select/Choose Destination/To Folder
  5. Confirm Transfer
  6. Macro Transfers all files, and displays log.

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.
  3. ENABLE this Macro.
    .
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    (all shown in the magenta color)
    • Set Variable “Local__ParentFolder” to Text “~/Documents/Test”
    • Set Variable “Local__ChooseFolderPrompt” to Text “Choose FOLDER to MOVE Items FROM”

TAGS: @Files @Folder @Move @Transfer @Finder @JXA

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.

Hi - is it possible to modify this so it works on a Finder selection instead? Thanks.

Sadly @JMichaelTX, the author of this Macro has passed away so, he will not be answering you. He did have another Macro in the Macro Library which seems to be what you want:

Also, for simply moving a selection of folders or files in the Finder to a designated folder you can use this simple Macro below (instead of the Desktop choose the Folder you want to move the files to by clicking on the folder icon to the right of the path field - or by typing in the path). This might not be the whole solution but it will get you started. The path can be a Variable so, you can build on this concept to make your own custom Macro.

EXAMPLE Move Finder Selection to a Folder.kmmacros (15.4 KB)

Click to Show Image of Macro

EXAMPLE Move Finder Selection to a Folder

https://wiki.keyboardmaestro.com/collection/Finders_Selection

Ok, will check it out. Thank you!