new automatic way of building the DMG package.
[AutomatorExifMover.git] / README.txt
blobd41e24f62868e843af73c5435d596f4cbb96d078
1 Author: Pierre Andrews
2 Version: 1.0
3 Release: 10 August 2007
4 URL: http://6v8.gamboni.org/Move-Rename-Files-according-to.html
5 License: GPL
7 ======================================================================
9 This is an action for Mac OS X Automator that takes a special path pattern and will try to rename the files it get in inputs according to that pattern.
11 We call it a "path pattern" because it can contain elements that will be replaced for each file with information coming for the meta data stored in the file.
13 ======================================================================
15 Example of moving photos
17 Let’s make an example. The script supports the EXIF meta data field included in photo files by your camera. It can therefore use them to move the images.
18 PNG - 23.2 kb
19 Example Results
21 Let’s say you have a bunch of images that you would want to move in directories named from the date they were taken at, like:
23     * 2007
24           o 08
25                 + 12
26                       # IMG_1.jpg
27                       # IMG_2.jpg
28           o 07
29                 + 25
30                       # IMG_3.jpg
31     * 2006
32           o 01
33                 + 28
34                       # IMG_4.jpg
36 You can set the path pattern parameter of the Automator action with the pattern: %Y/%m/%d/
38 The action will extract information from the EXIF data and replace the special markers in the pattern:
40     * %Y will be replaced by the year
41     * %m will be replaced by the month
42     * %d will be replaced by the day
44 the directory structure will be created and the file moved in the right directory.
46 ======================================================================
48 Installation
50 Once built, move the MetaDataMove.action file in the directory  /Library/Automator/ (for a particular user) or /Library/Automator/ (for all users)
52 ======================================================================
54 Special Patterns Elements
56 Most of the pattern — except for the date notation in the EXIF case — elements follow a simple notation, they are the name of a field in the file metadata with columns (’:’) around. You can use more than once the same marker in the pattern if you wish.
58 The available meta data fields change according to the file type you are passing to the action. The main fields for photos, music files and PDF are discussed later. Generally, the action uses ExifTool by Phil Harvey and therefore, the fields read by this tool can be used, for more details, please see ExifTool tag names documentation.
60 The action also offers some basic pattern elements:
62     * :basename: is the name of the file, without extensions,
63     * :ext: is the extension of the file, with the period (.),
64     * :cnt: will be replaced by the clash avoidance (see later) counter if a file with the same name already exists, otherwise, it will just be removed.
66 Detailed Behaviour
68 Here are the specifics on how the action deals with the different possible cases.
70 Trailing Slash
72 If the path pattern finishes with a /, then it is taken as the directory where the file should be moved, without being renamed.
74 File Renaming
76 If the path pattern doesn’t finish with a /, the last part of the path is supposed to be the renaming pattern for the file. If it doesn’t contain an extension (. followed by something), then the extension of the original file will be used.
78 File Clash avoiding
80 If the option overwrite is not checked, the action will avoid replacing an existing file with a file it is renaming. The action has two choices then:
82     * if the path pattern you specified uses the :cnt: special marker, it will replace this by a counter.
83     * otherwise, the action will add a counter at the end of the file name, just before the file extension. The action will start with the counter at 1 and try to write the file, if a file with the same counter already exist, it will increment the counter until it finds a new file name.
85 ======================================================================
87 This code uses ExifTool by Phil Harvey for all the metadata extraction:
88 http://www.sno.phy.queensu.ca/~phil/exiftool/
90 ======================================================================
92 This program is free software; you can redistribute it and/or modify
93 it under the terms of the GNU General Public License as published by
94 the Free Software Foundation; version 2 of the License.
96 This program is distributed in the hope that it will be useful,
97 but WITHOUT ANY WARRANTY; without even the implied warranty of
98 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
99 GNU General Public License for more details.
101 ----------------------------------------------------------------------