The Script Editor is a full-featured source code editor for JavaScript. You can open any number of Script
Editor document windows; each displays one Unicode source code document.

The Script Editor offers many useful and powerful text editing and navigation features. Some are intended
specifically for use with JavaScript, while others are useful for all kinds of text editing. Features include:

Navigation aids and options applicable to any kind of text, and specific code navigation for JavaScript;
see Navigation aids.

General editing and coding support such as undo-redo, and specific JavaScript coding support such
as syntax checking; see Coding aids.

A full-featured text search tool that can search in multiple files; see Searching in text.

Syntax marking (color and font styles for specific syntactic structures) for JavaScript and for many
other computer languages. The marking styles are configurable; see Syntax marking.

You can configure the Script Editor to display text with various features that help you track the structure of
your code, or that help you move around in the file. It also offers mouse and keyboard shortcuts for specific
types of cursor movement and text selection.

Syntax Highlighting allows you to turn syntax marking off, or set it to mark a particular language,
JavaScript or many other computer languages. The marking styles are configurable; see Syntax marking.

You can set the default values for any of these states using the Documents page of the Preferences dialog
(Edit > Preferences).

The Functions panel, and the flyout menu at the top right of the document window, both offer lists of
functions defined in the current document. When you select a function in either list, the document jumps
directly to that function definition in the code.

The Edit > Bookmarks menu allows you to set and clear navigation points in your text. The F2 function
key is the default shortcut key for the bookmark commands:

Toggle the bookmark for the current line using CTRL-F2.

Move the cursor to the next bookmark with F2, or to the previous one with SHIFT-F2. The bookmarks
wrap, so that the first follows the last.

Use SHIFT-CTRL-F2 to clear all bookmarks in the current text.

When you navigate to a bookmark in a collapsed section of code, that section automatically opens.

Bookmarks are marked with a blue, right-pointing arrow at the left of the line (to the right of the line
number if it is shown). This is the same place where a breakpoint is marked with a dot (see Setting breakpoints). If you have both a breakpoint and a bookmark set in the same line, the blue
arrow is superimposed on the breakpoint dot.

You can use the mouse or special keyboard shortcuts to move the insertion point or to select text in the
document window. Click the left mouse button in the document window to move the position caret.

To select text with the mouse, click in unselected text, then drag over the text to be selected. If you drag
above or below the currently displayed text, the text scrolls, continuing to select while scrolling. You can
also double-click to select a word, or triple-click to select a line.

To initiate a drag-and-drop of selected text, click in the block of selected text, then drag to the destination.
You can drag text from one document window to another. You can also drag text out of the Toolkit into
another application that accepts dragged text, and drag text from another application into a Toolkit
document window.

You can drop files from the Explorer or the Finder onto the Toolkit to open them in a document window.

The Keyboard Shortcuts page in the Preferences dialog (Edit > Preferences) allows you to set or modify
keyboard shortcuts for all menu commands.

In addition to the keyboard shortcuts specified for menu commands, and the usual keyboard input, the
document window accepts these special movement keys. You can also select text by using a movement
key while pressing SHIFT.

When you position the cursor in a document and begin typing, the Toolkit offers completion choices from
among keywords, global functions, functions that are defined in the current document, and functions
defined in the object-model dictionary that is currently selected from the flyout menu.

You can use the flyout menu at the upper right corner of the document window to choose an
object-model dictionary to use for completion. Available dictionaries depend on which applications are
loaded. See Inspecting object models.

When Word Wrap is off, you can automatically indent or outdent entire blocks of text. To indent a block of
text, select some or all of the text on the line or lines, and press TAB. (Be careful; if Word Wrap is on, this
deletes the selected text.) To outdent, press SHIFTTAB.

Use Edit > Comment or Uncomment Selection to temporarily remove parts of a JavaScript program from
the path of execution. This command is a toggle. When you first issue the command, it places the special
comment sequence //~ at the front of any line that is wholly or partially selected. When you next issue the
command with such a line selected, it removes that comment marker.

The command affects only the comment markers it places in the text; it ignores any comment markers that
were already in the selected lines. This allows you to temporarily remove and replace blocks of text that
include both code and comments.

A special comment format is reserved for a code versioning statement, which is used internally by Adobe
scripts, but is available to all scripters. Use Edit > Insert Version Tag to insert a comment containing the
file name and current date-time, in this format:

Choose Undo or Redo from the Edit menu or from the document window’s right-click context menu to
revoke and reinstate multiple editing changes sequentially. The change history is kept from when a file is
created or loaded, and maintained through file-save operations.

The results of a search are listed in the Find Results tab; by default, this is stacked with the Find and Replace
panel, but you can drag it to another stack, or display it as an independent floating panel.

Double-click a result line in the Find Results panel to jump directly to the document and line where the
text was found.

In a replace operation, you can use the captured regions of a match in the replacement expression by
using the placeholders \1 through \9, where \1 refers to the first captured region, \2 to the second, and so
on.

For example, if the search string is Fred\([1-9]\)XXX and the replace string is Sam\1YYY, when applied to
Fred2XXX the search generates Sam2YYY.

The Script Editor offers language-based syntax highlighting to aid in editing code. Although the
debugging features (including syntax checking) are only available for JavaScript, you can choose to edit
other kinds of code, and the syntax is highlighted according to the language. The style of syntax marking is
automatically set to match the file extension, or you can choose the language from the View > Syntax
Highlighting menu.

The style of highlighting is configurable, using the Fonts and Colors page of the Preferences dialog.