Blank titles of photos (temporary fix)

Post Reply
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Blank titles of photos (temporary fix)

Post by Eugene »

For some reason the photo files may contain the names of blanks, temporary fix:

1. Settings - Processing - Add

Name: Correct titles
Turn on "Button on the main form"

Script:

Code: Select all

procedure ProcessItem(aItem: TWmsScriptMediaItem);
begin
  if Trim(aItem.Properties[mpiTitle]) = '' then  
    aItem.Properties[mpiTitle] := ''
end;
 
var
  i: Integer;
  MediaItemList: TWmsScriptMediaItemList;
begin
  MediaItemList := WmsCurrentMediaListSelection;
  if (MediaItemList.Count > 0) or (WmsCurrentMediaListItem <> nil) then begin
    if MediaItemList.Count > 0 then try
      WmsShowInformation('Correct titles...');
      try
        for i := 0 to MediaItemList.Count - 1 do
          ProcessItem(MediaItemList[i])
      finally
        WmsHideInformation
      end    
    finally
      MediaItemList.Free
    end else
      ProcessItem(WmsCurrentMediaListItem);      
    WmsDatabaseAutoSave;
    MessageDlg('Correction titles is successful.', mtInformation, mbOK, 0)
  end else
    MessageDlg('No selected in the list of media resources.', mtError, mbOK, 0);
  ProcessMediaResult := True      
end.
Ok - Ok - Ok

2. List [Photo] - right click - Select all - click "Correct titles"
Post Reply