#newcommand@script VBScript'This script will work out if a picture is landscape of portrait and open it in an appropriately sized viewer windowFunction OnClick(ByRef clickData) If clickData.func.sourcetab.selected_files.count = 0 Then Msgbox "Nothing is selected",16, "NO FILE SELECTED" End If If clickData.func.sourcetab.selected_files.count > 1 Then iAnswer = MsgBox("WARNING: You have selected multiple images." & vbCr & vbCr & " YOU CANNOT PROCEED? " & vbCr & "PLEASE RE-SELECT THE IMAGE YOU WISH TO VIEW", vbYesNo + vbCritical,"IMAGE SELECTION ERROR") if iAnswer = vbNo Then ClickData.Func.Command.AddLine("Select NONE") ClickData.Func.command.Run Exit Function End If End If'Now discover if image is landscape of portraitFor Each selItem in clickData.func.sourcetab.selected Set piccyData = selItem.Metadata.image sider = piccydata.picheight bottomer= piccydata.picwidth if sider > bottomer Then foofle = "P" Else foofle = "L" End If Next'Now capture the file name of the image to me displayedFor Each SelectedItem In ClickData.Func.sourcetab.Selected dato = SelectedItem.create ClipString = SelectedItem.name_stem exto = SelectedItem.ext pathbo = selectedItem.path & "\" & ClipString & extoNext'If the image is Portrait set the viewer size and position and place the lister in the screen space remainingIf foofle = "P" Then ClickData.Func.Command.AddLine("Show """ & pathbo & """ POS 2340,0 SIZE 1500,2200 USEEXISTING") ClickData.Func.Command.AddLine("Set LISTERSIZE=2340,1786") ClickData.Func.Command.AddLine("Set LISTERPOS=0,10")'If the image is landscape set the viewer size and position and place the lister in the screen space remaining Else ClickData.Func.Command.AddLine("Show """ & pathbo & """ POS 1650,0 SIZE 2190,1500 USEEXISTING") ClickData.Func.Command.AddLine("Set LISTERSIZE=1640,2160") ClickData.Func.Command.AddLine("Set LISTERPOS=0,10") End if ClickData.Func.Command.AddLine("Show VIEWERCMD=""pathbo""") ClickData.Func.command.RunEnd Function