Home
Contents

Sophisticated Rename manual

Prev Page Next Page
 

Introduction
Data Plugin
Exif Master
The list of other available plugins.

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
month=August
day=24
...

If you request "year" (DATA), you will get "2004" (VALUE).

The table of functions.

For all functions, use dll name "sr.exe".

Function
Keys
Description
initdata
Creates a new data and sets a new value.
Nothing happens if the data already exists.
If TYPE is not given, the data will be considered as string.
If VALUE is not given, an empty line will be accepted for string and '0' will be accepted for integer.
DATA
The name of the data to create.
VALUE
Optional. Value to set.
TYPE
Optional. Data type - STR for string or INT for integer.
setdata
Sets a new value to an existing data, overwrites the previous value.
If data doesn't exist, it will be created.
DATA
The name of the data to modify.
VALUE
Value to set.
adddata
Adds a new value to an existing data.
If the data doesn't exists, VALUE will be added to 0 for INT and to an empty line for STR.
If TYPE is STR, the value will be added as string ('5'+'3'='53', 'qwer'+'12'='qwer12').
If TYPE is INT, the value will be added as signed integer (add: 5+3=8, substract: 5+-3=2).
If TYPE is INT and at least one of the values is not integer, an error will occur ('qwer'+12=error)
If TYPE is not given, the data will be considered as string.
DATA
The name of the data to modify.
VALUE
Value to add.
TYPE
Optional. Data type - STR for string or INT for integer.
getdata
Does nothing (used to return a value only).
DATA
The name of the data.
All functions return the 'VALUE' result key. This key contains the final value of the data after the modification.

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
DATA=*XXV GET DATA NAME|VALUE=*XVR EXIF DATE YEAR XX|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
Files - tutorial\coolnum\*.* or any other exif files.

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
Files - tutorial\coolnum\*.* (with exif) and tutorial\coolmove\*.* (without exif) or any other photos with and without exif.

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,
Function name: gettagvalue,
Result key: the_name_of_the_tag
Parameters: none

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.
b) FNumber tag returns result "F5,6" - we must delete "F" before inserting the tag to the template. Use variables again.

 

Other plugins.

The following plugins can be found at the SR homepage.

Data Plugin - store and process data during the renaming process.
SR can 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 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 define the type of the data beforehand - you can treat any data both as integer and string (when it is possible). The plugin is included into sr.exe. This pack contains demo files only.

Lists - rename files according to a prepared filelist.
If you have a list of existing files and a list of new file names to preceed with renaming, this plugin is for you. It understands 3 types of lists: a) old name - odd line, new name - even line; b) old and new names are separated by a special symbol or a set of symbols; c) there are two files - one file contains old names and the other one contains new names.

RegExpSR by Andrew Andreenkov - advanced search-and-replace using regular expressions.
The plugin allows you to use regular expressions in Sophisticated Rename. You can use the plugin with any SR datatype.

EXIF Master - inserts any EXIF tag to template.
SR has a few extra vars representing the most useful EXIF tags, such as datetime and image dimensions, but you can use this plugin to get such specific information as aperture, focal lenght, iso, shutter speed, etc. The plugin is included into sr.exe. This pack contains demo files only.

SaveID3 - saves vars to MP3 files as ID3 tags.
This plugin allows to save SR datatypes as ID3 tags. This may be used to extract the names of the songs from the names of the files. The plugin was used until this feature was implemented to the internal ID3 Updater. Still this plugin may be useful if you want to rename files and save ID3 tags during one processing to save time.

Truncate - automatically finds a common substring in all filenames and truncates it.
Some files may have an undesirable prefix, suffix or both. Generally, you need to setup a variable to get rid of them. Different sets of files may have different suffixes and it will take you long to reconfigure variables every time. This plugin finds such substrings automatically and gets rid of them, returning only useful parts of file names.

Mask - allows to use * and ? wildcards.
If you get used to work in DOS, you may find such a filtration useful, although you can also filter the files with the help of SR conditionals.

No More %20 - decodes hex codes after % symbol to normal letters. For example, %20 will be replaced by space character:
File%20downloaded%20from%20internet.htm -> File downloaded from internet.htm. There is also an option to replace spaces with any other string, for example, like this: File_downloaded_from_internet.htm. The plugin decodes not only %20 but all codes, for instance, %41 is 'A', etc.

Translit - transliteration from any language to English (or other).
Some localized file names may cause problems in the OSes or devices that understand only English file names. This is the case with most hardware MP3 players. You must transliterate foreign letters to English. The plugin has examples for Russian and German transliteration, but you can configure any other language as well. German transliteration means replacing "รค" to "ae" and so on.

Go to the main page.