UI controls error

Hello fellow Deadliners, I have put together a ui based around the ScriptUIExample which includes folder browsers and file browsers. When I run the UI from the general or submission panel in the launcher, there are no files showing when I go into the folder after using the FileBrowserControl. I have checked through Windows explorer and the files are there. If I drop down the list box that is supposed to hold the filename, it has a list of all the files in there, which is not what is supposed to happen.

The code for the ScripUIExample is as follows:
scriptDialog.AddRow()
scriptDialog.AddControl( “FileLabel”, “LabelControl”, “Select File”, labelWidth, -1 )
scriptDialog.AddSelectionControl( “FileBox”, “FileBrowserControl”, “”, “All Files (.)|.”, dialogWidth - labelWidth - 24, -1 )
scriptDialog.EndRow()

My example is as follows:
scriptDialog.AddRow()
maxFileButton = scriptDialog.AddSelectionControl( “maxFile”, “FileBrowserControl”, “”, “MAX (.max)|.max” , dialogWidth - labelWidth - 24, -1 )
scriptDialog.EndRow()

The only difference is the filter, which I have tested on mine as ‘All files’ as well, but neither seems to be performing as they should. I am confident that I have looked into this and it is the control that may be incorrect, but would appreciate some feedback as to the nature of this control and its usage.

The rest of the UI runs fine, though I am just beginning to test the scripts in R&D and this is the first hurdle I have come across. I did a check against ‘fileBrowserControl’ but nothing came up so I started this thread. if anyone else has a thread, please point me to it and I will make additional posts there.

Also, if anyone can see if I have done this incorrectly, I would welcome the critique and information

Thanks :ugeek:

In Deadline v6 onwards, the syntax changed slightly to just this:

"All Files (*.*)"

So your example should look like this:

scriptDialog.AddRow() maxFileButton = scriptDialog.AddSelectionControl( "maxFile", "FileBrowserControl", "", "3dsMax (*.max)" , dialogWidth - labelWidth - 24, -1 ) scriptDialog.EndRow()

Multiple File filters can be achieved as follows:

scriptDialog.AddRow() scriptDialog.AddControl( "FileLabel", "LabelControl", "Select File", labelWidth, -1 ) scriptDialog.AddSelectionControl( "FileBox", "FileBrowserControl", "", "Text Files (*.txt);;All Files (*.*)", dialogWidth - labelWidth - 24, -1 ) scriptDialog.EndRow()

Thanks for the reply Mike, that info is very welcome and appreciated . Is it actually documented anywhere about this change? I have the pdf downloads and did a search through them as well as looking through the online docs. If you can point me towards it, I will make sure the rest of the team know how to resolve it as well.

Is the code looking for a specific string with the extension? It seems that the only difference in your code and mine is the extensions syntax, which I have not seen anywhere as having to be definitive.

Thanks

The script API docs (pdf/chm) document this as follows:

However, to ease v5 → v6 upgrading customers, internal docs were also updated yesterday and on v6.2’s public release will be updated here: thinkboxsoftware.com/deadlin … ne.C2.AE_5

Hi Mike, I edited my post as I thought I needed to clarify, but you beat me to it so I made this one instead.

It does not say anything about the extensions syntax having to be definitive or of a certain structure, so I am not sure why the error has occurred. I had seen the code you pasted in, but as stated, it does not say anything about the string having to be a certain format. I was reading from the scripting reference pdf which is as follows:

5.40.3.6 def ScriptControl.ScriptControl.AddSelectionControl ( self, name, control, value, theFilter, width = -1, height = -1, tooltip = “”, browserLocation = “” )

Adds a selection control to the panel.
name: A unique name for the control. If the name is not unique, an error will be thrown.
control: The control type. The options are CheckBoxControl, FileBrowserControl, FileSaverControl,
FolderBrowserControl, MultiFileBrowserControl, MultiLineMultiFileBrowserControl, and
MultiLineMultiFolderBrowserControl.
value: The value for the control.
theFilter: This is the label for CheckBoxControl, and the filter for the file browser controls.
width: The width of the control, or -1 to use the default.
height: The height of the control, or -1 to use the default.
tooltip: A tooltip for the control.

It makes no reference to the example you have at the end of the code you pasted in from the chm file and does not say that it has to contain certain characters, but I have seen that the docs were updated yesterday and will be released when 6.2 is released to the public, so I will look to see when that is as I need to get our internal scripts updated asap.

Thanks

Yup, looks like the docs were updated between the public v6.1 release and the current v6.2 beta build with this useful amend.

If in doubt, we use Qt so you can always cross-reference their docs if you ever get stuck:
qt-project.org/doc/qt-4.8/qfiled … tml#filter