macOS_merge_copy
macOS_merge_copy copied to clipboard
Do Real Merge and Copy with a simple service on macOS Finder, just like Windows / Linux.
trafficstars
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.)
- Directly download the latest release and uncompress it.
- 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.)
- Done !
Way 2: Create services yourself.
- Open Automator app.
- Press [Command] + [N] to new a document which type is Service.
- Select Action > Library > Files & Folders > Get Selected Finder Items and drag it to the right side as Step One.
- Select Action > Library > Utillities > Run Shell Script and drag it to the right side as Step Two.
- Drop down Pass input of Step Two and select the to stdin.
- Copy content text of file from this project, ./src/merge_copy.sh, paste it as the Step Two shell content text.
- Look up the top, drop down Service receives selected and select files or folders.
- Press [Command] + [S] to save this service with specified name "Merge Copy" (or any custom name yourself).
- Done !
Usage
- Select files or directories in Finder, open conetxt menu and select Service > Merge Copy.
- Select target folder from second Finder dialog, your copying files and folder would paste and merge under this selected folder.
- Provide password if files or folders require premissions.
- That's all !

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
- Star this project if you like !
- Or you can donate me via
Donate me via PayPal
Donate me via OPay(歐付寶)
Reference
- https://grahamrpugh.com/2017/01/07/application-to-run-shell-commands-with-admin-rights.html
- https://stackoverflow.com/questions/39932522/applescript-how-to-get-full-path-of-the-current-finder-window-open