Resource

Resource Basics

Resource Name Remove All Placeholders
Resource Version 1.0
Category Version
Downloads 883
Release Date 6/24/2014 11:36:17 AM
 

Resource Details

Description This script will remove all the placeholder assignments, where applicable, for the selected images. This can''t be undone and so use only when you want to remove any existing placeholder assignments for a selection of versions.
Installation Instructions 1. Download the script
2. Save it on your hard drive
Usage Instructions 1. Select one or more versioned images that have placeholder assignments that you'd like to have removed
2. Select Tools->Scripter
3. Load this script
4. Run the script
Changes in this version n.a.
Special Requirements
 

Author Information

Author Name IDimager Support
 

Script

var
  i: Integer;
  AImage: TImageItem;
  AVersion: TCatalogItem;
  AProgress: TxomProgress;
begin
  if not Ask2('Are you sure you want to remove all placeholders?', 'This script will remove all the placeholder assignments, where applicable, for the selected images. This can''t be undone.') then
    exit;
  AProgress := TxomProgress.Create(nil);
  AProgress.Caption := 'Define place holder';
  AProgress.Max := Selected.Count;
  AProgress.CanCancel := True;
  for i := 0 to Selected.Count - 1 do
  begin
    AProgress.Pos := i + 1;
    if AProgress.Cancel then
      break;
    AImage := Selected.Items[i];
    if AImage._IsVersion then
    begin
      AVersion := TCatalogItem.Create(nil);
      if Catalog.FindImageCombined(AImage, AVersion, False, vptNone) then
      begin
        // remove all placeholders for version
        Catalog.RemovePlaceHoldersOfVersion(AVersion);
      end;
      AVersion.Free;
    end;
  end;
  AProgress.Free;
end;