'======================================================================================== 'Select modified files script 'by John Beardsworth 07/1/06 'version 1.2 'Loops through media items on screen and selects which ones need modifying '======================================================================================== Const kMsgBoxTitle = "Select files modified outside iView" Const txtOptions1 = "This script loops through all the visible media items and compares iView's update time" Const txtOptions2 = "with the original file, selecting those which need updating in the catalogue." Const txtOptions3 = "Do you want to rebuild modified items automatically?" Set IViewApp = CreateObject("iView.Application") If (IViewApp.Catalogs.Count = 0) Then MsgBox "Please launch Iview MediaPro.", vbCritical, kMsgBoxTitle End If msgOptions = txtOptions1 & vbCRLF & txtOptions2 & vbCRLF & vbCRLF & txtOptions3 varFix = MsgBox (msgOptions, vbYesNoCancel + vbQuestion , kMsgBoxTitle) if varFix <> vbCancel then Main(varFix) end if Sub Main(Rebuild) Set ivCat = IViewApp.ActiveCatalog Set objFSO = CreateObject("Scripting.FileSystemObject") For Each ivItem In ivCat.MediaItems if ivItem.mounted = true then Set objFile = objFSO.GetFile(ivItem.Path) If CDate( objFile.DateLastModified ) > ivItem.ModificationDate Then ivItem.Selected = True j = j+1 if Rebuild = vbYes then ivItem.Rebuild Else ivItem.Selected = False End If Set objFile = Nothing End if Next Set objFSO = Nothing if j = 1 And Rebuild = vbNo then msg = "1 record needs rebuilding and has been selected" elseif j > 1 And Rebuild = vbNo then msg = j & " records need rebuilding and have been selected" elseif j = 1 And Rebuild = vbYes then msg = j & " record has been rebuilt and is selected" elseif j > 1 And Rebuild = vbYes then Msg = j & " records have been rebuilt and are selected" else msg = "Records appear up to date" end if Msgbox msg , vbInformation, kMsgBoxTitle End sub