Page 1 of 1

Script UI Helpers

Posted: January 6th, 2005, 1:10 am
by vidpat
There seems to be some interest in facilitating the building of UIs. I wrote the following scripts to overcome some of the limitations of Adobe's script UI implementation. Below you will find a brief description of each script. I make modifications to them as needed, so they are still rough and should be considered under development. Please see the file itself for more detailed comments and usage. I hope these are of use.


A rudimentary layout manager for Adobe JavaScript UIs.

Include this file in your script.
Using this layout manager, you needn't concern yourself with specifying
meaningful bounds for UI components as they are added.
Prior to calling show() (or center()) on the Window object to layout, call
layoutUI() passing a reference to the Window object. This will lay out
the component and its children.
This script adds properties to several standard UI components that offer
control over the layout.

Download UILayout.jsx


Implementation of a combobox-like chooser with available UI components.

Include this file in your script.
When building a dialog Window, create an instance of ChooserUI passing a
reference to a Button in the Window. The Button text will indicate the
current choice. When clicked, a list of choices will appear allowing the
user to make a selection from the supplied choices.

Download UIChooser.jsx

Posted: February 25th, 2005, 4:02 pm
by vidpat
A while back I updated UILayout to provide more features and a more pleasing layout. The new and improved code should be compatible with any code using the previously available version.

New features include flow breaks and text layout that fits to the string length. Since there is no way to access the system font metrics, the script makes some assumptions about the dialog font. It has been tested on WinXP with standard appearance settings. Thus, it may need to be adjusted for other platforms and configurations. If you find that you need to change values to work on your configuration, please let me know and I'll update the script for future versions to use these values when appropriate.

I haven't tested this version as rigorously as the previous one. Please feel free to report any bugs, et cetera.

I refer you to the script's comments for usage, information on new features (denoted with "** As of 1.3"), and modifications you can make to the LM's defaults.

Download UILayout_13.jsx

Posted: September 16th, 2007, 8:48 am
by knubile
I can confirm this script works as is in CS3 when executed the usual way.

Can anyone confirm if they have managed to get this to work when trying to use it to layout a dockable panel(installed in ScriptUI Panels folder)?

I get no errors. My panel loads, but they're not laid out. All up against the left edge.