![]() ![]() If everything works, you can disable the "Get specified Finder items" action (right-click it, choose "Disable"). If you run the workflow at this point, you should be getting folders of images with the creation date changed. Here, the "$f" means "the input item", and the quotes ensure that any spaces or other special characters are kept as part of the folder name. That original dot means "the current directory", which in the original context means "the directory you just cd'ed to". Notice that I've replaced the dot in the original with "$f" (the quotes are required). Then use the popups to select these:įor f in -r '-alldates ![]() Without the correct directory, the 'exiftool' command won't do what you want. The "cd" to the folder with the files I want processed is a crucial command, because it sets the context for the 'exiftool' command line. To do that, we have to understand exactly what the original was doing, and what this script is expected to do.įirst, the original consists of two commands, not one. Next, you have to put the command in there correctly. So you now have the basic structure in place. More specifically, it's echoing the text of a command, but it's not actually executing it. This is so if you make a mistake (and you will, many times), you can more easily go back to the last thing that worked and try again.Ĭlick to expand.Given what you posted, it's just simulating the command. Programming is often a process of adding incremental changes to something that already works, and confirming it still works, but with whatever incremental change you made. If there's an error message, copy and paste the complete message and post it exactly as it appears. The main difference is it's a Service workflow instead of an Application one.Īgain, I advise starting with the prototype shell script, testing it, confirming it works. You'd build a Service in Automator in pretty much the same way. If you're working without a safety net, not so much. If you completely bork the image files, you can restore them. Make sure you have verified backups of every image file you use in testing. Check that the exiftool command worked by doing whatever is needed to check the date. Change the echo "$f" line in the shell script to be your exiftool command line. Next, it's time to edit the Run Shell Script's prototype. ![]() You can disable this step later (right-click on it, choose "Disable" from contextual menu). Run it and look at the results with just the prototype shell script. Use a "Get Specified Finder Items" action, and put it BEFORE Run Shell Script. You may then need to add another step before Run Shell Script to feed it example files. You should also spend a little time looking at the output, and understand how to read the results. ![]() All it will do is echo things dropped on it, but it should give you a sense of the steps that are happening. This choice will also give you a different shell command prototype to work from ("to stdin" has a "cat" prototype).įrankly, at this point you should save it and try running it. The third decision is how to pass input and you should choose "as arguments". The second decision is what action to add. It should be an Application, because this is what accepts items dropped onto it. The first decision to make in Automator is what kind of workflow to make. Basically, you put the command-line into an Automator workflow, and the workflow accepts drag-n-drops, runs the command, etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |