Batch script not working since upgrade

Post Reply
acertain
Posts: 45
Joined: 06 Jan 16 6:35

Batch script not working since upgrade

Post by acertain » 05 Sep 16 18:41

I have a script that copies the rating of the main version to a sub version. It worked fine in batch mode until I upgraded. It still works fine when I run it from the scripter, but when I run it from the batch, it pops up activity, but doesn't actually copy any ratings. Any ideas?

Andrew

Code: Select all

{
 Author: A Certain
 Version: 1.0

 Description:

 This script will copy any ratings from the master version to all sub versions.
}

var
  i: Integer;
  AMain: TCatalogItem;
  ACatItem: TCatalogItem;
  AItem: TImageItem;
begin
  if not Ask ('Are you sure you want to copy the master versions rating to all sub-versions of the selected images?' + CrLf2 + 'Beware; This is permanent and is not undoable!!') then
    exit;

  Progress.Cancel := False;
  Progress.Max := Selected.Count;
  Progress.Pos := 0;

  Progress.Show;


  AMain := TCatalogItem.Create(nil);
  ACatItem := TCatalogItem.Create(nil);
  try
    for i := 0 to Selected.Count - 1 do
    begin
      Progress.Pos := i + 1;
      Progress.ProgressText := Selected.Items[i].FileNameOnly;

      AItem := Selected.Items[i];
      if not AItem._isVersion then
        continue;
      else
      begin
        if Catalog.FindImageCombined (Selected.Items[i], AMain, True, phtNone) then
          if AMain.Rating > 0 then
            if Catalog.FindImageCombined (Selected.Items[i], ACatItem, False, phtNone) then
            begin
              ACatItem.Rating := AMain.Rating;
              Catalog.StoreItemToDatabase (ACatItem, False);
            end;
      end;

      if Progress.Cancel then
        break;
      end;
  finally
    AMain.Free;
    ACatItem.Free;
  end;

  Progress.Hide;

  if Progress.Cancel then
    Say ('Cancelled')
end;

fbungarz
Posts: 3185
Joined: 08 Dec 06 5:03
Location: Arizona, USA

Re: Batch script not working since upgrade

Post by fbungarz » 05 Sep 16 21:27

Why do you not simply use cascading?
Also: you probably know that you can set preferences to do this automatically?
Frank

acertain
Posts: 45
Joined: 06 Jan 16 6:35

Re: Batch script not working since upgrade

Post by acertain » 06 Sep 16 0:17

I don't know about cascading. How does that work?

acertain
Posts: 45
Joined: 06 Jan 16 6:35

Re: Batch script not working since upgrade

Post by acertain » 06 Sep 16 0:19

And no, I haven't seen any preferences for ratings to apply to all versions. I just re-looked. Where would that be?

Thanks.

Andrew

acertain
Posts: 45
Joined: 06 Jan 16 6:35

Re: Batch script not working since upgrade

Post by acertain » 06 Sep 16 0:19

Feel free to point me at a manual, as well.

Andrew

sanphotgn
Posts: 469
Joined: 26 Aug 07 18:06

Re: Batch script not working since upgrade

Post by sanphotgn » 06 Sep 16 1:15

Is this issue similar to this issue:

http://forum.idimager.com/viewtopic.php?f=57&t=24267
Photo Supreme 3.3.0.2602 (64 bits) (Windows)

fbungarz
Posts: 3185
Joined: 08 Dec 06 5:03
Location: Arizona, USA

Re: Batch script not working since upgrade

Post by fbungarz » 06 Sep 16 10:08

Hi Andrew,
sorry, I had forgotten that the automatic assigning of star ratings and color labels requires a registry tweak, have a look at:
http://www.senoiaphoto.com/psu

Here the scripts:
Cascade Metadata: This setting will propagate the star rating and color label within a version set. A value of 0 will set it back to default

Code: Select all

Options.CatalogMetaCascadeStyle := 1;

Code: Select all

PublicBroadcast (nil, 'SaveOptions', nil);
This registry tweak unfortunately only propagates star ratings and color labels. If you would like to cascade metadata as well, you will still need the cascading option.

This option, to cascade metadata, is unfortunately very well hidden (!!!) and accessible only via a rather inconvenient click on the tiny version tabs. First you need to hover over the tab, then move the mose to the tiny triangle and left-click it, then left-click "Cascade from this version set...".
[BTW - you can cascade data from main to all subversions, or from one subversion to all other versions including the main one.]

This all requires quite a bit of dexterity especially if you use this option frequently (as I do to ensure metadata across versions are consistent). I have asked for quite some time that at least a shortcut be implemented. Feel free to support my request here: http://mantis.idimager.com/view.php?id=2959

Anyway - here two screenshots how to cascade metadata:
Cascading_1.jpg
Cascading_1.jpg (88.73 KiB) Viewed 2951 times
When you cascade the metadata you have a choice, which metadata you want to cascade. This menu then pops up:
Cascading_2.jpg
Cascading_2.jpg (77.95 KiB) Viewed 2951 times
Hope that helps,
Frank

acertain
Posts: 45
Joined: 06 Jan 16 6:35

Re: Batch script not working since upgrade

Post by acertain » 07 Sep 16 15:09

Thanks for all the info. Will give that a try!

Andrew

acertain
Posts: 45
Joined: 06 Jan 16 6:35

Re: Batch script not working since upgrade

Post by acertain » 10 Sep 16 21:36

OK, finally getting time to look back at this.

1) I like star ratings to be cascaded, but color labels not, so the registry tweak isn't what I need.
2) Cascading stuff via a point-and-click interface is great for one-offs, but often I have a big batch to edit.
3) I did look at that other post, but my issue didn't seem to be the same.
4) The recent update to 3.3.0.2570 fixed the problem!

Thanks to all!

Andrew

fbungarz
Posts: 3185
Joined: 08 Dec 06 5:03
Location: Arizona, USA

Re: Batch script not working since upgrade

Post by fbungarz » 10 Sep 16 21:41

2) Cascading stuff via a point-and-click interface is great for one-offs, but often I have a big batch to edit.
FYI you can select several images and batch cascade too...

Post Reply