|
|||||||||||
|
Introduction Plugins (intro).The unlimited power of SR is explained by the ability to work with plugins. SR includes only general features that can be useful for almost all users. The purpose of plugins is to meet the specific requirements of a certain user. It's impossible to write a program that will satisfy everyone, but it's possible to write separate plugins for different tasks of any difficulty! Right now you can check out the plugins that were already created. SR comes with 2 built-in general purpose plugins: Data Plugin and Exif Master.
DATA Plugin.Introduction. Earlier SR versions could only keep some user data in conditionals, the data being accessible only for current file name. With this plugin you will be able to store string and/or integer data which will be accessible from the beginning to the end of the whole renaming process. An interesting feature is that you don't need to set the type of the data beforehand - you can treat any data both as integer and string (when it is possible). Installation. The plugin is already built into sr.exe. The distributive archive with demo files and examples can be downloaded from SR home page. It has the same folder structure as the main SR folder. So just copy all the files to the corresponding folders on your hard disk. How it works. A buffer will be temporarily created in the memory. It will contain lines like this: year=2004 If you request "year" (DATA), you will get "2004" (VALUE). The table of functions. For all functions, use dll name "sr.exe".
You can use other variables as input keys DATA and VALUE, for example, you may set absolute values or functions' names: DATA=MYEXIFDATE|VALUE=2004|TYPE=INT The external variables which call this plugin can be used as inputs for SR variables and conditionals. Examples. Example presets and tutorial files for this plugin can be found at the SR home page. Example 1: cool counter. Preset - presets\coolnum Some time ago a user wrote and asked how to solve such a problem: there are a lot of digital photos with exif metadata. They should be renamed in the following way - first goes the full date (YYYYMMDD), then a counter, but there should be a separate counter for each day. We needed a specific plugin to store dates and the counter value for each date. Now this task can be easily done by means of this universal plugin. First we create a data for YYYYMMDD information. It will be different for different days. We use 'setdata' to update it for each file in the list. There will be as many datas as we have different shooting days. If we want to begin with 000, we should insert data initialization to set the initial counter value to -1, it will be initialized only once for each date (initdata). But in this example we want to begin with 001, so we don't need to initialize a new data - it will be automatically set to 0 when we try to add 1 to it. The last step is to add 1 to the data with the name YYYYMMDD. The rest of the preset is intended to allign numbers to 3-symbols (001 instead of 1, 012 instead of 12, etc) We could have done it more easily with the help of conditionals, but one more example for DATA plugin won't be out of place here. Example 2: move files to specific folders. Preset - presets\coolmove This is a more simple example. We need to move all the files with exif information to the exif date 'YYYYMMDD' folders and all the files without exif to the file date 'NOEXIF\YYMMDD' folders. The root folder for the renamed files should be asked before the processing. The folders should be created automatically. Piece of cake! We create two data cells to join YYYY+MM+DD for exif and file dates, then we use conditionals to check the presence or exif. If there is no exif, we create "file date" folder, else we create "exif date" folder. One more conditional is used to add "NOEXIF" subfolder to the files without exif metadata.. Both presets were tried with more than 4200 photos - all works fine!
Exif Master.Introduction. This plugin allows you to insert any EXIF tag into the template. Installation. The plugin is already built into sr.exe. The distributive archive with demo files and examples can be downloaded from SR home page. It has the same folder structure as the main SR folder. So just copy all the files to the corresponding folders on your hard disk. General. Purpose: returns the value of a given exif tag. Supports virtually all tags including maker specific data. Dll name: sr.exe, Notes: You should look for the tags' names in the EXIF Viewer (complete info). The names of the tags are the things that are written at the beginning of each line before '='. Some tags of different cameras are known to be different. For example, to get the iso ratings from Olympus camera, you should request the value of "ISOSpeedRatings", but for Canon Powershot cameras it will be "CCD ISO". Example. Example preset for this plugin can be found at the SR home page. The task is to add Exposure and Fnumber to the file name in such a way: "file name T(1-630) F(5,6)". We will use the files from "tutorial\lesson-8" (dacha-7.jpg, izmaylovo-23.jpg, vladimir-14.jpg, vladimir-2.jpg). Drag these files to SR and load "em" preset. You will see the desired results. But it's not that simple. a) ExposureTime retutns "1/630 sec" - we must get rid of
prohibited "/" character and "sec" part. This can be easily done by
means of variables (in this example "/" was replaced with "-", you
may use anything you want instead of it.
Other plugins.The following plugins can be found at the SR homepage. Data Plugin - store and process data during the renaming
process. Lists - rename files according to a prepared
filelist. RegExpSR by Andrew Andreenkov - advanced
search-and-replace using regular expressions. EXIF Master - inserts any EXIF tag to template. SaveID3 - saves vars to MP3 files as ID3 tags. Truncate - automatically finds a common substring in all
filenames and truncates it. Mask - allows to use * and ? wildcards. No More %20 - decodes hex codes after % symbol to normal
letters. For example, %20 will be replaced by space character: Translit - transliteration from any language to English
(or other). |