Working with image collections

Discussion in 'Scripting and Programming' started by George Silvis, Apr 3, 2018.

  1. George Silvis

    George Silvis Cyanogen Customer

    Joined:
    Dec 4, 2014
    Messages:
    33
    Having a problem with the error "MaxIm DL 6: Could not access collection Item method".

    How can I create a collection of images currently open in MD that I can feed to the CombineImages method?

    Thanks
    George

    Code:
    Set MaximApp= CreateObject("Maxim.Application")   
    Set AllDocs = MaximApp.Documents
    
    ' subs to call
    DoSkims
    
    Sub DoSkims
      ' process the SKIMxx images.
      dim Dlist : Set Dlist= CreateObject("System.Collections.ArrayList")
      dim Llist : Set Llist= CreateObject("System.Collections.ArrayList")
       
      For I = 1 To AllDocs.Count
         Set bDoc= AllDocs.Item(I)
         if "SKIMD" = Left(bDoc.DisplayName, 5) then
            Dlist.Add bDoc
         end if   
         if "SKIML" = Left(bDoc.DisplayName, 5) then
            Llist.Add bDoc
         end if   
      Next
       
      Set DDoc= CreateObject("Maxim.Document")
      DDoc.DisplayName= "MED-SKIMD.fit"
      DDoc.CombineImages 2, false, 2, false, Dlist ' no-align, , median,
       
      Set LDoc= CreateObject("Maxim.Document")
      LDoc.DisplayName= "MED-SKIML.fit"
      LDoc.CombineImages 2, false, 2, false, Llist ' no-align, , median,
      Set FDoc= LDoc.Duplicate()
      FDoc.DisplayName= "Final-SKIM.fit"
      FDoc.AddConstant(1000)
      FDoc.Substract(DDoc)
    End Sub
    
    
     

Share This Page