masken,here's a script (RC3) that calls the ms common dialog activex control for picking a filename, it can also be used for picking a printer and choosing a font ...
problem is - you need one of the ms visual studio development packages installed before you can use it - like vb or c++ ... I'm wondering if the vb runtimes would be enough ?
Give it a try anyway - if the object create fails, it will pump-out an @ERROR message ...
code:
break on
$Filename = OpenCommonDialog("All files (*.*)|*.*", "Open file", "c:\", "",0)
?"filename = " $Filename
exit
Function OpenCommonDialog($Filter,$Title,$Directory,$Extension,$FileMustExist)
$OpenCommonDialog = ""
$Dialog = CreateObject("MSComDlg.CommonDialog")
If @error = 0
$Dialog.Filter = $Filter
$Dialog.DialogTitle = $Title
$Dialog.InitDir = $Directory
$Dialog.Extension = $Extention
$Dialog.MaxFileSize = 128
If $FileMustExist
$Dialog.Flags = 4096
EndIf
$Dialog.ShowOpen()
$OpenCommonDialog = $Dialog.Filename
Else
?"ERROR @ERROR : @SERROR"
EndIf
EndFunction
-Shawn