A Noob Question From An Experienced Scripter: What's The Definition Of "Accessory View"?


I’m fluent in AppleScript but not so in AppleScript-ObjC and its applications. Since I used the now discontinued 24UAppearance OSAX scripting addition that allowed enhanced user interaction on old macOS – unfortunately, the development of this addition was dropped with the roll-out of Mojave – I downloaded and installed Dialog Toolkit+ to regain the lost functionality and set about looking into its feature set. I perused the script sample published in this forum section but as detailed as it was I’d like to get to the bottom regarding the term of “accessory view” as in

acc view width integer : The width of the accessory view in points

I’m not a developer so the terminology appears a tad muddy. Is “accessory view” another word for a UI element? I appreciate someone shedding light.

It can be a UI element, or a view containing one or more UI elements.

1 Like

As Shane pointed out it’s an additional view you can add to the standard “Alerts” which provide Header Text, Info text and Buttoms. I use accessory views when wanting to allow
The user to provide more information.
After the alert is completed (ends modal) I can check the elements I provided to the accessory view and get data from them such as a textfield’s string value, a check buttons state etc

The only places I use accessory views are Shane’s DialogToolkitPlus and Shane’s Myriad tables.

They give my scripts a far better user interface.

If you want to explore their use I’d look at the documentation and examples provided with DialogToolkit.

Freeware | Late Night Software

Dialog Toolkit Plus v1.1.2

Dialog Toolkit Plus is an ASObjC-based script library for showing enhanced dialogs. Add multiple text entry fields, checkboxes, popup menus, radio buttons, path controls, extra buttons, secure fields, images, and rules to dialogs. It requires macOS 10.10 or later.

Thanks, I know where to download them, and I know what this piece of software does. All I wanted was to clarify the term accessory view, hence the reason I created this thread. The words accessory and view seemed confusing. The former implies an auxiliary function (a synonym of appendage, addition, attachment) and the latter sounds too general.
From the documentation, it gives the impression that accessory view is every UI element of the dialog except the title bar, the icon and the buttons. In this interpretation, the bottom of accessory view and the top of accessory view refer to the area made by exclusion of the aforementioned elements not relative to the edge of the dialog’s body. Is it the case?

And that’s the case.

An example might help. Consider a save dialog. There are several fixed elements – the sidebar, the stuff at the top, the list, and the buttons. And app can modify these is minor ways, but that’s all. But it can provide an accessory view, and the OS will place it above the buttons at the bottom.

This is how apps customize various otherwise-fixed dialogs.