View Single Post
  #1540  
Old 09.10.2020, 17:55
marka marka is offline
Modem User
 
Join Date: Oct 2020
Posts: 3
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Add metadata to image file, using external program
// Trigger: "A Download Stopped"
// External program required: ExifTool by Phil Harvey (http://www.sno.phy.queensu.ca/~phil/exiftool/)
// IMPORTANT: Remove any command line parameters included in the executable. For e.g. in Windows OS, rename 'exiftool(-k).exe' to 'exiftool.exe'

if (link.isFinished()) {
    var filePath = link.getDownloadPath();
    var ext = getPath(filePath).getExtension();
    var supported = ["jpg", "tiff"]; // <- Specify supported file types.

    if (supported.indexOf(ext) > -1) {
        var comment = link.getComment();

        if (comment) {
            var exiftool = "c:/portable/exiftool/exiftool.exe"; // <- Set full path to "exiftool.exe"
            var tagName = "comment"; // <- For the comment to be visible in the OS file properties viewer, use OS compatible tag name.
            comment = comment.replace(/"/g, "'");
            callAsync(function() {}, exiftool, "-overwrite_original", "-" + tagName + "=" + comment, filePath);
        }
    }
}
Hello, I would like to change the "Title" from Filname with the exiftool.
Thats the comman I use:
Code:
exiftool '-PDF:Title<${filename;s/\..*?$//}' '-XMP-dc:Tile<${filename;s/\.[^.]*$//}'
Unfortunatly I dont really understand this sript. How can i add this to the provided script?
Reply With Quote