' Name: ViewsClearSymbols
'
' Title: Delete all the symbols in Views containing a certain key
'
' Topics: Views
'
' Description: Delete all the Maucha and Pie symbols in Views containing a certain key,
'              to save space when saving project.
'
' Author: Michael Silberbauer 2002-03-27
' Institute for Water Quality Studies, Department of Water and Sanitation
' Private Bag X313 PRETORIA South Africa 0001
'
'
' Requires: A set of consistently-named views
' Self:
'
' Results:
' -----------------------------------------------------------------------------

theProject = av.GetProject
ViewL = List.Make
DocumentList = theProject.GetDocs
for each anItem in DocumentList
  if (anItem.is(view)) then
    if ((anItem.GetName.AsString.Contains("Pie").Not) and (anItem.GetName.AsString.Contains("Key").Not)) then
      ViewL.Add(anItem)
    end
  end
end
sieve = MsgBox.Input("Enter a view selection string","SIEVE","View_")
if (sieve=nil) then
  MsgBox.Info("No views to process","CANCELLED")
  return nil
end
ViewList = List.Make
for each aView in ViewL
  if (aView.GetName.AsString.Contains(sieve)) then
    ViewList.Add(aView)
  end
end
if (ViewList=nil) then
  MsgBox.Info("No views to delete","CHEAP ROUND!")
  return nil
end
for each nView in ViewList
  myDoc = theProject.FindDoc(nView.AsString)
  if ((myDoc<>nil) and (MsgBox.YesNo(nView.AsString,"REMOVE SYMBOLS?",false))) then
    theWindow = nView.GetWin
    theWindow.Activate
    'av.Run( "JuanitaPieDelete", { } )
    'av.Run( "MauchaDelete", { } )

    theWindow.Close
  end
end