I am trying to write a script to use with HelpNDoc.
I am part way there:
var
aList: THndLibraryItemsInfoArray;
nCnt: Integer;
begin
// Get all items in the library
aList := HndLibraryItems.GetItemList([]);
// Go through each of them
for nCnt := 0 to Length(aList) - 1 do
begin
// Is this a image (1)?
// Is this a image map (9) ?
if(HndLibraryItems.GetItemKind(aList[nCnt].id) = 1 or HndLibraryItems.GetItemKind(aList[nCnt].id) = 9) then
// What is the default alternate text?
var aDefaultAltText := HndLibraryItemsMeta.GetItemMetaStringValue(aList[nCnt].id, 'defaultalttext', '');
// Update the alternate text if required
if(aDefaultAltText = '') then
// Now what do we do? We need to find all instances of where this library item has been used.
// When we encounter one that has an alternate text description we update the meta.
// How?
end;
// What is the default padding?
var aDefaultPadding := HndLibraryItemsMeta.GetItemMetaIntValue(aList[nCnt].id, 'defaultpadding', 0);
// Update padding if required
if(aDefaultPadding = 0) then
HndLibraryItemsMeta.SetItemMetaIntValue(aList[nCnt].id, 'defaultpadding', 5);
end;
end;
end.
I can:
The issue is with the alternate text. If it does not have a default value then I want to do this:
If, by the end of iteration it did not find a alternate text value that was not empty it prints the library item name on screen.
It is not possible to do what I wanted via the API.
Response from HelpNDoc:
HelpNDoc's API doesn't include ways to iterate over topic content.