Jump to content

Move folder


Recommended Posts

I am indebted to @exposition for his original post that provided the inspiration for this workflow and also for his assistance in testing beta versions of it and in helping to make the Read Me…well…more readable. Any remaining errors and infelicities are all mine, of course.

 

The workflow has no dependencies.

 

WARNING
One option in this workflow allows you to merge two identically named folders (which is the default in the workflow configuration).  Before you use that function for the first time please backup your original folder and any identically named folder located in the destination so that you can check, without risk of losing data, that the function works as you expect.

Introduction
Select a single folder in Finder, activate Alfred using your Universal Action hotkey then use this workflow to move that folder and its files to a destination of your choice. If an identically named folder exists in the destination you will be offered the options of either overwriting that folder or of merging the contents of both folders. The latter option produces a folder in the destination containing both the files from the original folder (which will be moved to the Bin/Trash) and the files that were already in the identically named folder.

Configuration
When there is an identically named folder in the destination:

  • You will have the option of either overwriting the identically named folder or of merging the files from the two folders.
  • If the checkbox in the workflow configuration is checked (which is the default setting) the menu offering the choices will appear like this:

Merge.png.df14ac4171e7776c18b639d8905bbf38.png

 

  • If the checkbox in the configuration is not checked the menu offering the choices will appear like this:

Overwrite.png.1ad012de39db534cffc86d07c51a4cd4.png


The options available are the same but the default menu choice (which you can select by pressing ⏎) changes. The purpose of the configuration is to allow you to have your most-used function as the easily accessible default.

Usage
Select a single folder in Finder, activate Alfred using your Universal Action hotkey and find the workflow by starting to type Move folder:
UA.thumb.png.30d193a1a24457f159b10eba69bf3aa8.png
Press ⏎ and you will be prompted for the name of the destination. Start typing the folder name and select the folder you want:
Destination.thumb.png.150dc1a63628a7d0ff8df2baa7531e79.png
If an identically named folder does not exist in the destination the selected folder will simply be moved to the destination.

If, however, an identically named folder does exist you will see one of the two dialogs shown under Configuration above. (Which you see will depend upon whether or not the checkbox in the configuration is checked.)

 

If you choose to merge the files they will be merged in the destination and the original folder will be moved to the Bin/Trash.

If you choose to overwrite the existing folder the moved folder and its contents will replace the identically named folder in the chosen destination.

Creation of log file on merge
When you choose to merge two identically named folders a log file (called mergelog.txt) is created in the workflow's home folder. To see it right click on the workflow name in Alfred's preferences and choose Open in Finder. You can then open the mergelog.txt file in your default text editor to see exactly what changes were made during the merging of the folders.

Note that the log file is overwritten by each fresh merge to prevent it becoming unwieldy.

 

The GitHub download link.

 

Stephen

 

 

Link to comment
  • 3 months later...
On 10/17/2023 at 3:56 AM, exposition said:

Thank you very much for all of your hard work, @Stephen_C!

@Stephen_C hi Stephen, this is a great workflow to move files to new folder.

 

I would like to use this as base and see if I can create new workflow that moves selected files to destination (existing or new folder) and then open the new location with moved files selected at this location. Is this feasible? Pls guide

Link to comment

You can pass the new folder path to an Open File action to open the new folder. I'm afraid just at the moment I don't have spare time to investigate selecting the files in the folder but I suspect anyway you'll learn more by trying to work that out for yourself than by having someone tell you. 😀

 

Stephen

Link to comment

Thanks Stephen. I was using "Reveal in Finder". Now destination folder is opening up as I have used {var:newBaseFolder} in Open File action. Selecting moved files at destination would have been ideal but this will be for future :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...