sitephones.blogg.se

Automator mac move files to new dated folder
Automator mac move files to new dated folder








automator mac move files to new dated folder automator mac move files to new dated folder

Now we need to write a shell script that will actually put that as the name of the file. What I've done in Automator is I've created a new Quick Action Automator document. I've set it to receive files or folders in the Finder. You can see here if you search for it and drag it over. Now you end up with an area that you can write the shell script in. You can set the shell to what you want by default and maybe bash. I'm going to use zsh, z shell, because that's the default now in Catalina. This will probably work in either zsh or bash. So in this I'm going to set the shell script to Pass input as arguments. It's very important to change that because otherwise the default is standard in. So then you have a for loop that can loop through the arguments which are represented by the dollar sign and the at symbol there. It's going to loop through everything that's into it. It's going to do, it's going to loop, and then it's going do exactly what we just did in Terminal. But it's going to set that to a variable. It's important not to have spaces around the equals there. We're also going to get the path to file and the file name itself.You do that by doing file name is $f, that the f from here looping through all of the files that has passed in. Then you do colon t and then file path is colon h. Then we're going to do a simple mv command which is move.

automator mac move files to new dated folder

You can use the move command to also rename files. All rename is is moving a file from one place to another with a new name, right. So we'll do the filepath slash and then in curly brackets we'll put the two different names. The first one is the original name and the second one is the new name. #Automator mac move files to new dated folder how to#.










Automator mac move files to new dated folder