Skip to content

pilisir/macOS_merge_copy

Repository files navigation

macOS merge copy service

Leave away drag and drop with [option] key and say Goodbye to the "Replace". Do Real Merge with a simple service on macOS Finder, just like Windows / Linux.

中文版

Feature

  • Copy selected files or folders to a target folder and append as children if not existing or overwrite otherwise.

Install

There are two way to create the services.

Way 1: Copy and Paste (If you run into a problem about encoding of workflow file while trying this way, please try Way 2 instead.)
  1. Directly download the latest release and uncompress it.
  2. Move the service file to the local service folder. You can easily copy merge copy.workflow to your local $USER/Library/Services/ directory. (Please set your Finder to be able to see hidden directories via shortcut key [Shift] + [Command] + [.] first.)
  3. Done !
Way 2: Create services yourself.
  1. Open Automator app.
  2. Press [Command] + [N] to new a document which type is Service.
  3. Select Action > Library > Files & Folders > Get Selected Finder Items and drag it to the right side as Step One.
  4. Select Action > Library > Utillities > Run Shell Script and drag it to the right side as Step Two.
  5. Drop down Pass input of Step Two and select the to stdin.
  6. Copy content text of file from this project, ./src/merge_copy.sh, paste it as the Step Two shell content text.
  7. Look up the top, drop down Service receives selected and select files or folders.
  8. Press [Command] + [S] to save this service with specified name "Merge Copy" (or any custom name yourself).
  9. Done !

Usage

  1. Select files or directories in Finder, open conetxt menu and select Service > Merge Copy.
  2. Select target folder from second Finder dialog, your copying files and folder would paste and merge under this selected folder.
  3. Provide password if files or folders require premissions.
  4. That's all ! context menu

Recommend to set Shortcut Key

  • You can assign shortcut key for the service via Keyboard in System Preferences to make things more easily.
  • Recommend [Control] + [Command] + [M], meaning as Merge.
  • Tutorial

FYI

  • I never test it lower than Mojave.
  • You may find out the script is not elegant itself, because this is just my second project of Automator with shell script. I look forward to any suggestion or fork.

License

MIT License

Encourage

Reference