A viewer is Script Debugger’s powerful, flexible way of displaying an AppleScript value. Viewers appear, or can be generated, in several parts of the Script Debugger interface. The result of running a script initially appears as a viewer pane in the script’s drawer, aspects of an error from running a script may appear in a viewer pane, and double-clicking a line of an explorer view opens a separate viewer window.
A viewer pane, such as the result pane, can itself be reopened as an individual viewer window. This can be a very convenient thing to do, especially when the result pane contains a lot of information. To separate off a result pane off as an individual window, choose Script > Show Result in Viewer. (Alternatively, use the “tools” popup menu at the upper right of the result pane. Choose the Show Result in Viewer item.)
A separate viewer window, or a cascade of separate viewer windows (as shown in the illustration below, which shows three viewer windows in front of an explorer view), can be a way to focus more easily on the information that interests you.
If there is a change in the data from which a viewer window was generated, the viewer window changes. For example, you can display a script result as a separate window and leave that window open. Every time you run your script, this separate result viewer window will change to show the new result. Similarly, if you open a separate viewer window from an explorer and then reload the data in the explorer, the viewer window will change (if necessary) to reflect the changed data.
Viewer windows and viewer panes have many options and capabilities.
There are also various other options for how material is displayed in each view. These are essentially the same as certain display options for script windows. Where appropriate, you can toggle wrapping, and you can show tab stops, invisible characters, and spaces.
To set defaults for the size, view, and display options of viewer windows:
There are two menus within the viewer: the “tool” popup menu at the upper right of the viewer (it has an icon like a gear), and the contextual menu (control-click to summon it). They bring together the above options, along with some additional capabilities. You can look up a class or native datatype in the dictionary. If what’s being viewed is an alias or some other reference to a file on disk, you can reveal or open the corresponding item in the Finder.