Configuring Scripting Preferences
Script Editor preferences allows you to configure a variety of aspects of scripting behavior.
In the General pane of Script Editor preferences (), you can configure settings such as the following.
Default Language—The default scripting language when you create new Script Editor documents.
Show “tell” application menu—This setting can be enabled to add a tell application menu to the navigation bar. Selecting an app in this menu allows you to direct script execution to the chosen app. In
tell application "Finder" statement. It automatically understands the Finder’s terminology and sends events to the Finder.
In addition, the current application object—which refers to the application currently executing the script—reflects the selected application, rather than Script Editor. Seeand .
name of current application
--> Result: "Finder"
// Result: "Finder"
Show inherited items—This setting can be enabled to display inherited object properties in the dictionary viewer. For example, in the Finder, a
file object inherits the attributes of an
item object. Without this setting enabled, the dictionary entry for
file simply provide a a pointer to the
item entry to view the
item attributes. See . With this option enabled, the
file entry in the Finder’s scripting dictionary includes the attributes of an
item. See .
Script Menu—These settings allow you to enable and configure a systemwide script menu (). This menu can be used to organize your scripts and provide access to them in any app.
In the Editing pane of Script Editor preferences, shown in, you can configure settings such as the following.
Code completion—When this option is enabled, Script Editor suggest code completions as you type a script ().
To accept and insert a code completion suggestion, press the F5 key or the Esc (Escape) key. If multiple code completion choices are available, a code completion dialog appears, allowing you to select a suggestion (see).
Tab width and line wrapping—Adjust how indentation and line wrapping occurs in the editor pane of Script Editor documents.
Escape tabs and line breaks in strings—This setting only affects AppleScripts. When this option is disabled, tabs and line breaks appear normally in a text string, as shown in.
When this option is enabled, tabs and line breaks are replaced with escaped character equivalents—
/t for a tab, and
/r for a line break. See .
In the Formatting pane of Script Editor window (), you can configure the style—font, point size, and color—of various script attributes, including new text, language keywords, comments, and variables. Formatting options are language-specific. Select a language from the Language popup menu to view that language’s formatting settings.
In the History pane of Script Editor preferences (), you can enable or disable the log history, adjust the quantity of log history entries, and enable logging only when the log is visible.
The Plug-ins pane of Script Editor preferences () lists any installed Script Editor plug-ins.