View Single Post
  #107  
Old 29.05.2017, 11:40
PeTaKo
Guest
 
Posts: n/a
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 (**External links are only visible to Support Staff**// 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/exfitool/exiftool.exe"; // <- Set full path to "exiftool.exe".
            comment = comment.replace(/"/g, "'");
            callAsync(function() {}, exiftool, "-overwrite_original", "-comment=" + comment, filePath);
        }
    }
}
Hi mgpai, thank you so much, but i was unable to make it work :(

I used this code:

Code:
// Add metadata to image file, using external program
// Trigger: "A Download Stopped"
// External program required: ExifTool by Phil Harvey (**External links are only visible to Support Staff****External links are only visible to Support Staff**)
// 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:/exiftool/exiftool.exe"; // <- Set full path to "exiftool.exe".
            comment = comment.replace(/"/g, "'");
            callAsync(function() {}, exiftool, "-overwrite_original", "-comment=" + comment, filePath);
        }
    }
}
I renamed the executable and I placed in the same path of the script. The trigger is also OK. I have windows 10 and don't know what i'm doing wrong since other scripts work well for me.

The first times I ran it i got a javascript error, but now I don't get any error, it just doesn't work.

Any suggestion?

Thanks in advance.

Last edited by raztoki; 29.05.2017 at 11:56.
Reply With Quote