EXIF Conditional Rename

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: EXIF Conditional Rename

Post by highend »

Anywhere you like, just use a fixed path for $ahkHelper.

Like

Code: Select all

$ahkHelper = "D:\Tools\My little programs\xyEditItemNamesWindow_Helper.exe
Or wherever you like to store it...
One of my scripts helped you out? Please donate via Paypal

aimy
Posts: 181
Joined: 26 Feb 2007 15:44

Re: EXIF Conditional Rename

Post by aimy »

Thank you highend.

So, this is my code:

Code: Select all

    $shift = 8; // Time (in hours to shift the time)
    $previewNames = "";
    $ahkHelper = "D:\SugarSync\Programs\Settings\xyEditItemNamesWindow_Helper.exe"

    $clip = "<clipboard>"; // Store current clipboard data

    foreach($item, <get SelectedItemsPathNames |>, "|") {
        $device = property("CameraModel", $item);
        $baseName = getpathcomponent($item, "base");
        $extension = getpathcomponent($item, "ext");
        $date = formatdate(property("WhenTaken", $item), "yyyymmdd.hhnnss", "h", $shift);
        if ($device == "SAMSUNG PL150 / VLUU PL150 / SAMSUNG TL210 / SAMSUNG PL151") {
            $pattern = "$date-$baseName¬SAMSUNG PL151.$extension";
        } elseif ($device == "SM-N9005") {
            $pattern = "$date¬SM-N9005.$extension";
        } else {
            $pattern = "$date-$baseName¬$device.$extension";
        }
        $previewNames = $previewNames . $pattern . "<crlf>";
    }
    $previewNames = formatlist($previewNames, "e", "<crlf>");
    copytext "$previewNames";
    run """$ahkHelper""";
    #147;
    copytext $clip; // Restore clipboard data
But it doesn't work as expected. The moment I click the script button, it suddenly open Windows Explorer and hang my PC for a while.

Is there anything wrong with my $ahkHelper setting?

Thank you.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: EXIF Conditional Rename

Post by bdeshi »

aimy wrote:

Code: Select all

    $ahkHelper = "D:\SugarSync\Programs\Settings\xyEditItemNamesWindow_Helper.exe"
[/size]
End this line with semicolon.

Code: Select all

    $ahkHelper = "D:\SugarSync\Programs\Settings\xyEditItemNamesWindow_Helper.exe";
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

aimy
Posts: 181
Joined: 26 Feb 2007 15:44

Re: EXIF Conditional Rename

Post by aimy »

SammaySarkar wrote:
aimy wrote:

Code: Select all

    $ahkHelper = "D:\SugarSync\Programs\Settings\xyEditItemNamesWindow_Helper.exe"
[/size]
End this line with semicolon.

Code: Select all

    $ahkHelper = "D:\SugarSync\Programs\Settings\xyEditItemNamesWindow_Helper.exe";
I'm sorry about that.

Thank you so much.

It works now.

Post Reply