Overview Details Screenshots Comparison Store Press Releases Support About
PreFab UI Browser
Features and Benefits
![]()
UI Browser and GUI Scripting
GUI Scripting is a technology for Mac OS X that adds simple, plain-English commands to AppleScript to control applications by scripting their user interface. With a whole new world of possibilities now open, there hasn't been so much excitement in the AppleScript community since the release of AppleScript Studio and Automator. GUI Scripting is likely to have far wider impact because it brings previously impossible automation tasks into the reach of every scripter.
But, as early adopters have discovered, there is one difficult aspect of GUI Scripting that has every scripter puzzled: how to figure out the "containment hierarchy" of the target application's user interface elements. Every application has its own idiosyncratic arrangement of containers, many of which are internal conveniences and not visible to users. Furthermore, many user controls have no names and therefore have to be scripted by their index numberswhich often have no relationship to their visual layout. While you can use AppleScript itself to decipher these mysteries, it is very awkward and time consuming.
UI Browser saves the day! Just fire it up, choose the target application or use the new built-in Screen Reader or press a hot key to read the screen under the mouse, and look at the main browser window. A few clicks and a couple of scrolls, and you see the exact containment hierarchy, complete with every UI element's title (if it has one) and its AppleScript index number.
We even save you the trouble of writing it down. With UI Browser's unique "AppleScript" menu, several different kinds of AppleScript statement are generated for you, including object references, get and set commands for object properties, action commands, and keystroke commands. The generated AppleScript statement appears in a separate window. If you aren't sure whether you prefer the AppleScript Name reference form or the Index reference form when both are available, click a button to switch instantly between reference forms! The generated AppleScript statement is already selected for you, ready to edit, or to copy immediately and paste into your favorite script editor or drag directly into your drag-and-drop enabled script editor. Better yet, set a preference to copy it to the clipboard or send it directly to your default script editor automatically.
It doesn't end there. Before you design your script, and while you're fine tuning and testing it, you can use UI Browser's ability to set properties and send actions to make sure the target application will respond as you expect. Not every application is fully accessible, in part because some applications include custom user controls that haven't yet been made accessible. Instead of banging your head against the wall for hours because you think you haven't written your script correctly, just try to set the property or send the action using UI Browser. If it doesn't work in UI Browser, it most likely isn't your script that is at fault. Or, just maybe, you will find a way to make the target application respond that wasn't immediately obvious to your AppleScript instincts. UI Browser is not based on AppleScript, System Events, or GUI Scripting; it is based directly on the same Accessibility API that GUI Scripting uses. If UI Browser can't make the target dance, GUI Scripting probably can't either.
![]()
UI Browser is a user interface navigator
With UI Browser, you can "see" almost every window, user control and menu item of a targeted application, without bringing the target application to the front. You can see at a glance, in a familiar Mac OS X columnar view, where all of the target's menus, containers and controls are located, easily navigating through all of its windows, sheets, drawers, tab views and other containers without having to open any of them. To keep you from getting lost, UI Browser's Path view gives you a compact outline of the path from the target application's root element to any UI element you select, with an ordered list of all intermediate elements, including many that are not normally visible to users. UI Browser can even highlight the actual UI element whose name is selected in the column view. You can also see in UI Browser's Attributes view all of the properties of any UI Element in the target, including its role, title, position and size, and current state.
![]()
UI Browser is a user interface actor
Using standardized controls suitable for each type of data the target application recognizes, you can set the value of every user-settable element in the target—edit the contents of its text fields, set and reset its checkboxes, adjust its sliders, press its radio buttons and much more, all without touching the target application's GUI. You can also perform every action supported by the target, such as opening, zooming, minimizing and closing its windows, moving its scroll bars, and choosing menu items in its menu bar, pop-up menus and menu buttons. You can even issue menu item and button commands to the target application by sending their keyboard shortcuts to it, and you can "type" individual characters into the active text field or text view of the target application.
![]()
UI Browser is a user interface observer
You can tell UI Browser to observe notifications that are broadcast by Mac OS X applications when any changes take place in their user interfacewhether because a user clicked a control in the target application, chose a menu item, or typed some characters, or because an AppleScript command took effect or a network administrator or user took some action, or because you did something to the target with UI Browser itself! You can use notifications to monitor an application's response to GUI Scripting and other commands.
UI Browser and Accessibility
PreFab Software has unmatched experience controlling the GUI via scripts, releasing PreFab Player in 1994 with continued sales and support today for Mac OS 9 and earlier. Now, PreFab brings its expertise to you on Mac OS X with UI Browser, a utility to support Apple's GUI Scripting technology.
Apple released Mac OS X 10.3 Panther in October 2003, including by default full support for GUI Scripting. GUI Scripting is a technology for Mac OS X having many similarities to PreFab Player. It allows you to manipulate any Macintosh application by writing simple AppleScript scripts to control its menus, buttons and other user controls, even if the target application is not scriptable. For more information about GUI Scripting, visit Apple's
GUI Scripting Web site.
Formerly, in Mac OS X 10.2.3 Jaguar and newer, GUI Scripting was only available to users who specially downloaded and installed a beta version made available by Apple for public testing. Because GUI Scripting is now automatically installed by default on all Macintosh computers running Mac OS X 10.3 Panther or newer, you can distribute your scripts for use "out of the box."
GUI Scripting brings Apple's Accessibility technology to every scripter, enabling you to explore and manipulate the user interface of almost all Mac OS X applications running on your computer. It doesn't matter whether they were written for the Carbon environment or the Cocoa environment, or whether they were written in C, C++ or Objective-C—if they were written using one of Apple's standard programming environments, Apple has already made sure they are accessible.
PreFab UI Browser and Apple's GUI Scripting both rely on "Accessibility" technology that is designed to make the Macintosh more accessible to persons with disabilities. This technology was new to the Macintosh in Mac OS X 10.2 Jaguar, and Apple has made substantial changes in Panther and Tiger. As Apple continues to improve Accessibility in the future, UI Browser will automatically take advantage of many of these changes.
Note that custom controls in some applications may not be accessible to GUI Scripting or UI Browser until their developers release a new version that supports accessibility.
Updated on December 22, 2006. Send questions or comments to
support@prefabsoftware.com.
identifies links that will take you out of the PreFab site.