Team LiB   Previous Section   Next Section
Apple Menu Options

Syntax

tell app "Apple Menu Options"

   activate

   set recentStuff to recent items enabled (* this is an Apple Menu 

   Options property *)

end tell

Dictionary commands

quit

This command quits the control panel (i.e., it is no longer running and loaded into memory).

run

Sending the run command is the same as double-clicking the control panel or choosing it from the Apple menu Control Panels submenu.

get (reference to an object)

Use this command to get the value of a property, such as:

tell app "Apple Menu Options" to get submenus

enabled

get returns the value of the property.

as (class)

You can use the optional labeled parameter as, followed by data of type class, to specify the type of data to return (rather than the default, which is a boolean or integer for this control panel's properties).

set (reference to an object)

Change how the Apple menu behaves by setting a value, such as:

tell app "Apple Menu Options" to set maximum recent documents to

12

This code stores up to 12 aliases to the documents that you had open recently.

to

The to labeled parameter is required; otherwise the app would not know what value the script wants to set the property to.

Dictionary classes

application

This class represents the Apple Menu Options control panel. It has the following five properties. To obtain the values of these properties, use code such as:

tell app "Apple Menu Options" to get maximum recent documents
submenus enabled (boolean)

This returns true if passing the mouse over a folder item in the Apple menu, such as Control Panels, produces a submenu displaying the contents of that folder. You usually want this feature enabled in order to execute control panels. But you can remove submenus from the Apple menu with code such as:

tell app "Apple Menu Options" to set submenus enabled to false.
recent items enabled (boolean)

This is a true/false value indicating whether the Apple menu keeps track of recent items, such as applications, documents, or servers.

maximum recent applications (integer)

Scripters can get or set the number of apps the Apple menu creates aliases for by viewing or changing this integer property value:

set maxApps to maximum recent applications.
maximum recent documents (integer)

This is an integer that represents the number of documents the Apple menu displays in its Recent Documents folder.

maximum recent servers (integer)

This command represents the number of recent servers that the Apple menu displays, as in:

set maximum recent servers to 4

Examples

tell app "Apple Menu Options"

   (* Set your preferences for the Apple menu *)

   set submenus enabled to true

   set recent items enabled to true

   set maximum recent applications to 6

   set maximum recent documents to 12

   set maximum recent  servers to 1

end tell
    Team LiB   Previous Section   Next Section