The Current View Property

The next Finder window property we’ll examine is the current view property. The value of this property is the method used to display the contents of the Finder window, and can be one of four enumerations: icon view, list view, column view, and (new in Mac OS X v10.5) flow view. Like the target and toolbar visible properties, this property can be both read and edited:

Click to open example in the Script Editor applicationThe value of the current view property matches the view mode currently used by the Finder window.
 

tell application "Finder" to ¬
 get the current view of the front Finder window
 --> returns either: icon view, list view, flow view, or column view

Try these scripts and watch as the front Finder window changes its method of display:

Click to open example in the Script Editor applicationScripts to change the view mode of the frontmost Finder window.
 

tell application "Finder" to ¬
 set the current view of the front Finder window to list view

tell application "Finder" to ¬
 set the current view of the front Finder window to column view

tell application "Finder" to ¬
 set the current view of the front Finder window to flow view
 --> flow view is new in Mac OS X v10.5 (Leopard)

tell application "Finder" to ¬
 set the current view of the front Finder window to icon view

The flow view in Mac OS X v10.5 (Leopard)

Window management is an issue that most of us deal with on a daily basis. We’re often moving, resizing, and adjusting windows to facilitate the access and control of information. The current view property controls how the contents of Finder window are displayed. The next two properties pertain to the placement and sizing of Finder windows.

TIP: If you’re the kind of person who likes all folders to open in the same view mode, here’s a simple tell statement that will change the view display mode of every folder within an indicated folder, such as your home directory:

tell application "Finder" to set the current view of ¬
 the window of every folder of home to icon view

TOP | CONTINUE