Difference between revisions of "ReNamer:Scripts"

From den4b Wiki
Jump to navigation Jump to search
m (Reverted edits by HenryOwens (Talk) to last revision by Den4b)
(→‎3rd party libraries: ExifTool script added.)
 
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Up|ReNamer:Pascal Script}}
 +
 
This page contains a collection of scripts which can be used in [[ReNamer]]'s [[ReNamer:Rules:PascalScript|PascalScript rule]].
 
This page contains a collection of scripts which can be used in [[ReNamer]]'s [[ReNamer:Rules:PascalScript|PascalScript rule]].
  
== 3rd party libraries ==
+
== Educational scripts ==
 
+
 
{| class="wikitable"
 
{| class="wikitable"
 
! Script
 
! Script
 
! Description
 
! Description
! Temp Forum Link
 
 
|-
 
|-
| [[ReNamer:Scripts:TrID|TrID]]
+
| [[ReNamer:Scripts:Initialize|Initialize]]
| Detecting file extension
+
| How to initialize the code.
| http://www.den4b.com/forum/viewtopic.php?id=550
+
|-
 +
| [[ReNamer:Scripts:Import DLL|Import DLL]]
 +
| Demonstrates how to call functions of 3rd party DLL.
 +
|-
 +
| [[ReNamer:Scripts:Date and Time|Date and Time]]
 +
| How to use date and time of the file.
 
|-
 
|-
| [[ReNamer:Scripts:Xpdf|Xpdf]]
+
| [[ReNamer:Scripts:Move filename portion|Move filename portion]]
| Extract PDF tags
+
| How to move part of the filename to a new position.
| http://www.den4b.com/forum/viewtopic.php?id=349
 
 
|-
 
|-
| [[ReNamer:Scripts:Exiv2|Exiv2]]
+
| [[ReNamer:Scripts:Index filenames|Index filenames]]
| Extract EXIF/IPTC/XMP tags from any images
+
| How to insert an incrementing number into the filename.
|
+
|}
http://www.den4b.com/forum/viewtopic.php?id=407
+
 
 +
== 3rd party libraries ==
  
http://www.den4b.com/forum/viewtopic.php?id=109
+
Each of these scripts needs a third-party software ("library").
|}
 
  
== Educational scripts ==
+
Download and install the required software as directed, before using these scripts.
 
'''NOTE: This section might not be needed as most will probably go into user manual section as snippets of code!'''
 
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! Script
 
! Script
 
! Description
 
! Description
 +
! Forum Link
 
|-
 
|-
| Initialize
+
| [[ReNamer:Scripts:TrID|TrID]]
| How to initialize the code
+
| Detecting file extension.
 +
| http://www.den4b.com/forum/viewtopic.php?id=550
 
|-
 
|-
| Import DLL functions
+
| [[ReNamer:Scripts:Xpdf|Xpdf]]
| Demonstrates how to call functions of 3rd party DLL
+
| Extract PDF tags.
 +
| http://www.den4b.com/forum/viewtopic.php?id=349
 
|-
 
|-
| Date and Time
+
| [[ReNamer:Scripts:Exiv2|Exiv2]]
| How to use date and time of the file
+
| Extract EXIF/IPTC/XMP tags from any images.
 +
| http://www.den4b.com/forum/viewtopic.php?id=407<br/>http://www.den4b.com/forum/viewtopic.php?id=109
 
|-
 
|-
| Index filenames
+
| [[ReNamer:Scripts:ExifTool|ExifTool]]
| Insert a simple index to filenames
+
| Extract EXIF/IPTC/XMP tags from any images.
 +
|
 
|-
 
|-
| ...
+
| [[ReNamer:Scripts:MediaInfo|MediaInfo]]
| ...
+
| Extract meta information from audio and video files.
 +
|
 
|}
 
|}
  
 
== User scripts  ==
 
== User scripts  ==
 +
The following scripts are taken from the User forum. In some cases, links are provided to the thread, so that you can check the details of the use case.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 54: Line 64:
 
! Script  
 
! Script  
 
! Description  
 
! Description  
! Temp Forum Link
+
! Forum Link
 
|-
 
|-
 
| [[ReNamer:Scripts:Separate words|Separate words]]
 
| [[ReNamer:Scripts:Separate words|Separate words]]
 
| Insert a space in front of each capitalized letter.
 
| Insert a space in front of each capitalized letter.
| [http://www.den4b.com/forum/viewtopic.php?pid=2529#p2529 http://www.den4b.com/forum/viewtopic.php?pid=2529#p2529]
+
| http://www.den4b.com/forum/viewtopic.php?pid=2529#p2529
 
|-
 
|-
 
| [[ReNamer:Scripts:AVI video codec|AVI video codec]]
 
| [[ReNamer:Scripts:AVI video codec|AVI video codec]]
 
| Extract name of video codec used encoding AVI file.
 
| Extract name of video codec used encoding AVI file.
| [http://www.den4b.com/forum/viewtopic.php?pid=3484#p3484 http://www.den4b.com/forum/viewtopic.php?pid=3484#p3484]
+
| http://www.den4b.com/forum/viewtopic.php?pid=3484#p3484
 
|-
 
|-
 
| [[ReNamer:Scripts:RegEx Case Convertion|RegEx Case Convertion]]
 
| [[ReNamer:Scripts:RegEx Case Convertion|RegEx Case Convertion]]
 
| Convert case of capturing groups of your regular expression.
 
| Convert case of capturing groups of your regular expression.
|  
+
| http://www.den4b.com/forum/viewtopic.php?pid=3454#p3454<br/>http://www.den4b.com/forum/viewtopic.php?pid=3459#p3459
[http://www.den4b.com/forum/viewtopic.php?pid=3454#p3454 http://www.den4b.com/forum/viewtopic.php?pid=3454#p3454]
 
 
 
[http://www.den4b.com/forum/viewtopic.php?pid=3459#p3459 http://www.den4b.com/forum/viewtopic.php?pid=3459#p3459]
 
 
|-
 
|-
 
| [[ReNamer:Scripts:Using MasterFile|Using MasterFile]]
 
| [[ReNamer:Scripts:Using MasterFile|Using MasterFile]]
 
| Renaming folder basing on the MetaTag of the first file in the folder. In this particular case: adding the ID3_Year metatag from the mp3 file to it's parent folder name.
 
| Renaming folder basing on the MetaTag of the first file in the folder. In this particular case: adding the ID3_Year metatag from the mp3 file to it's parent folder name.
| [http://www.den4b.com/forum/viewtopic.php?pid=1626#p1626 http://www.den4b.com/forum/viewtopic.php?pid=1626#p1626]
+
| http://www.den4b.com/forum/viewtopic.php?pid=1626#p1626
 
|-
 
|-
 
| [[ReNamer:Scripts:Hours span|Hours span]]
 
| [[ReNamer:Scripts:Hours span|Hours span]]
| Add hours to a date embedded in the filename in format yyyy-mm-dd hh-nn-ss.JPG
+
| Add hours to a date embedded in the filename in format "yyyy-mm-dd hh-nn-ss.JPG".
| [http://www.den4b.com/forum/viewtopic.php?id=696 http://www.den4b.com/forum/viewtopic.php?id=696]
+
| http://www.den4b.com/forum/viewtopic.php?id=696
 
|-
 
|-
| ...
+
| [[ReNamer:Scripts:Roman numerals serialization|Roman numerals serialization]]
| ...
+
| Serialization with Roman numerals.
| ...
+
| http://www.den4b.com/forum/viewtopic.php?id=828<br/>http://www.den4b.com/forum/viewtopic.php?pid=3327#p3327
 +
|-
 +
| [[ReNamer:Scripts:EAN-13|EAN-13 checksum]]
 +
| Calculate the checksum digit for the [http://en.wikipedia.org/wiki/EAN-13 EAN-13 barcode].
 +
| http://www.den4b.com/forum/viewtopic.php?id=930
 +
|-
 +
| [[ReNamer:Scripts:Serialize duplicates|Serialize duplicates]]
 +
|colspan="2"| Serialize duplicated filenames by append a counter to the filename.
 +
|-
 +
| [[ReNamer:Scripts:Partial case change|Partial case change]]
 +
|colspan="2"| Change case of specific parts of the file name.
 +
|-
 +
| [[ReNamer:Scripts:URL decode|URL decode]]
 +
|colspan="2"| Decode a URL encoded filename.
 +
|-
 +
| [[ReNamer:Scripts:Index files per folder|Index files per folder]]
 +
|colspan="2"| This script adds a serialization index to the end of every file on per folder basis. The index is incremented only when the folder path changes.
 +
|-
 +
| [[ReNamer:Scripts:Random characters and length|Random characters and length]]
 +
|colspan="2"| Generate new names consisting of random selection of characters and of random length.
 +
|-
 +
| [[ReNamer:Scripts:Convert file content from ANSI to UTF-8|Convert file content from ANSI to UTF-8]]
 +
|colspan="2"| Convert the content of processed files from ANSI (default system code page) to UTF-8 encoding.
 
|}
 
|}
 +
 +
[[Category:ReNamer]]
 +
[[Category:Pascal Script]]

Latest revision as of 12:32, 6 January 2020

This page contains a collection of scripts which can be used in ReNamer's PascalScript rule.

Educational scripts

Script Description
Initialize How to initialize the code.
Import DLL Demonstrates how to call functions of 3rd party DLL.
Date and Time How to use date and time of the file.
Move filename portion How to move part of the filename to a new position.
Index filenames How to insert an incrementing number into the filename.

3rd party libraries

Each of these scripts needs a third-party software ("library").

Download and install the required software as directed, before using these scripts.

Script Description Forum Link
TrID Detecting file extension. http://www.den4b.com/forum/viewtopic.php?id=550
Xpdf Extract PDF tags. http://www.den4b.com/forum/viewtopic.php?id=349
Exiv2 Extract EXIF/IPTC/XMP tags from any images. http://www.den4b.com/forum/viewtopic.php?id=407
http://www.den4b.com/forum/viewtopic.php?id=109
ExifTool Extract EXIF/IPTC/XMP tags from any images.
MediaInfo Extract meta information from audio and video files.

User scripts

The following scripts are taken from the User forum. In some cases, links are provided to the thread, so that you can check the details of the use case.

Script Description Forum Link
Separate words Insert a space in front of each capitalized letter. http://www.den4b.com/forum/viewtopic.php?pid=2529#p2529
AVI video codec Extract name of video codec used encoding AVI file. http://www.den4b.com/forum/viewtopic.php?pid=3484#p3484
RegEx Case Convertion Convert case of capturing groups of your regular expression. http://www.den4b.com/forum/viewtopic.php?pid=3454#p3454
http://www.den4b.com/forum/viewtopic.php?pid=3459#p3459
Using MasterFile Renaming folder basing on the MetaTag of the first file in the folder. In this particular case: adding the ID3_Year metatag from the mp3 file to it's parent folder name. http://www.den4b.com/forum/viewtopic.php?pid=1626#p1626
Hours span Add hours to a date embedded in the filename in format "yyyy-mm-dd hh-nn-ss.JPG". http://www.den4b.com/forum/viewtopic.php?id=696
Roman numerals serialization Serialization with Roman numerals. http://www.den4b.com/forum/viewtopic.php?id=828
http://www.den4b.com/forum/viewtopic.php?pid=3327#p3327
EAN-13 checksum Calculate the checksum digit for the EAN-13 barcode. http://www.den4b.com/forum/viewtopic.php?id=930
Serialize duplicates Serialize duplicated filenames by append a counter to the filename.
Partial case change Change case of specific parts of the file name.
URL decode Decode a URL encoded filename.
Index files per folder This script adds a serialization index to the end of every file on per folder basis. The index is incremented only when the folder path changes.
Random characters and length Generate new names consisting of random selection of characters and of random length.
Convert file content from ANSI to UTF-8 Convert the content of processed files from ANSI (default system code page) to UTF-8 encoding.