'======================================================================================== 'iView XML generator 'by John Beardsworth 15/2/07 'version 1.1 ' '======================================================================================== 'Variables that are used in the XML 'These are things you can change 'in Action> Convert Images, set up a saved setting for the large size images Const svLargeSettings = "Adobe Media Gallery Large" Const svMediumSettings = "Adobe Media Gallery Medium" Const svSmallSettings = "Adobe Media Gallery Small" Const svThumbSettings = "Adobe Media Gallery Thumb" 'and one for the thumbnails Const sizThumb = 100 Const sizSmall = 200 Const sizMedium = 350 Const sizLarge = 1300 varEncoding = 8 'or 16 Const conAuthor = "John Beardsworth" ' Const conEmail = "your@address.co.uk" Const conEmail = "www.beardsworth.co.uk/email.php" conSiteTitle = "Nunhead Cemetery" conTopRightTitle = "The last snowfall in London" Const groupDescription = "" '======================================================================================== 'specify the root folder for the output 'you can hard code over this if you want - eg svFolder = "d:\website" svFolder = BrowseForfolder() kFilename = svFolder & "\resources\mediaGroupData\group.xml" conSiteTitle = InputBox("Enter the main title", appName ) conTopRightTitle = InputBox("Enter the subtitle", appName ) Main() Sub Main() 'Now move on to iView Set ivApp = CreateObject("iView.Application") Set ivCat = ivApp.ActiveCatalog If (ivApp.Catalogs.Count = 0) Then MsgBox "Please launch Iview MediaPro.", vbCritical, appName exit sub End If kRegenerate = MsgBox ("Output images?", vbQuestion + vbYesNo, appName) If kRegenerate = vbYes then 'Output the images and the thumbnails ivCat.ConvertImages svFolder & "\bin\images\large" , True , svLargeSettings ivCat.ConvertImages svFolder & "\bin\images\medium" , True , svMediumSettings ivCat.ConvertImages svFolder & "\bin\images\small" , True , svSmallSettings ivCat.ConvertImages svFolder & "\bin\images\thumb" , True , svThumbSettings ' copy Set fso = CreateObject("Scripting.FileSystemObject") ' fso.CopyFolder svFolder & "\bin\images\large" , svFolder & "\bin\images\medium" ,TRUE ' fso.CopyFolder svFolder & "\bin\images\large" , svFolder & "\bin\images\small" ,TRUE End if 'Copy the Flash and html Set fs2 = CreateObject("Scripting.FileSystemObject") Set f2 = fs2.createtextFile(kFilename ) f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" & conAuthor & "" f2.writeline "iView to Adobe Media Gallery" f2.writeline "" & now() & "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" & conTopRightTitle & "" f2.writeline "" & groupDescription & "" f2.writeline "" & conSiteTitle & "" f2.writeline "" & conAuthor & "" f2.writeline "mailto:" & conEmail & "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" Set ivItems = ivCat.Selection ivRecordCount = ivItems.Count f2.writeline "" 'this loops through For Each ivItem In ivItems f2.writeline "" f2.writeline "" & ivItem.Annotations.Title & "" f2.writeline "" & ivItem.Annotations.Description & " (Ref: " & mid(ivItem.name, 8, 6) & ")" f2.writeline "" & ivItem.Annotations.CopyrightNotice & "" ' f2.writeline "" f2.writeline "" f2.writeline "" ivName = left(ivItem.Name, len (ivItem.Name)-3) & "JPG" ' f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" f2.writeline "" Next f2.writeline "" f2.writeline "" f2.Close msgbox svFolder & " created with " & ivCat.Selection.Count & " record(s)" End sub Function BrowseForfolder() 'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/shell/browseforfolder.asp ' oFolder = Shell.BrowseForFolder(Hwnd, sTitle, iOptions [, vRootFolder]) ssfWINDOWS = 36 ssfWINDOWS = "" Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.BrowseForfolder(0, "Set output folder for the Flash movie and images", 0, ssfWINDOWS) If (Not objFolder Is Nothing) Then BrowseForfolder = objFolder.Self.Path End If Set objShell = Nothing End Function