I want to parse a Dlg.title to display "file" if one file selected or "files" if several.
How to modify this.?
Set dlg = DOpus.Dlg
Dim cmdDelete
Dim txtNum
Set cmdDelete = DOpus.Create.Command()
dlg.window = DOpus.Listers(0)
dlg.message = "Delete File"
'If numfiles>1 Then
' txtNum = " the file?"
'Else
' txtNum = " the files?"
'End If
dlg.title = "Do You Want to Delete"' + txtNum
dlg.buttons = "OK|Delete without Recycling|Cancel"
ret = dlg.Show
If ret = 1 Then
cmdDelete.RunCommand("Delete")
ElseIf ret = 2 Then
cmdDelete.RunCommand("Delete NORECYCLE")
End If
The default script has an example of checking selected item count:
If clickData.func.sourcetab.selected.count = 0 Then
DOpus.Output " (none)"
Else
...
End If
Remember that folders may also be selected. selected gives you both the selected folders and files. You can also use selected_dirs and selected_files to get just the selected folders or files.