CHAPTER 2: The ExtendScript Toolkit The Script Editor 24
/**
* @@@BUILDINFO@@@ SnpCreateDialog.jsx !Version! Tue Dec 05 2006 08:03:38 GMT-0800
*/
You are responsible for manually updating the !Version! portion with your own version information.
Undo and redo
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.
Syntax checking
Before running the new script or saving the text as a script file, use Edit > Check Syntax to check whether
the text contains JavaScript syntax errors. The default keyboard shortcut is F7.
X If the script is syntactically correct, the status line shows “No syntax errors.”
X If the Toolkit finds a syntax error, such as a missing quote, it highlights the affected text, plays a sound,
and shows the error message in the status line so you can fix the error.
Multiline statements
The Script Editor supports triple-quote syntax to allow strings to span several source code lines. When
entering a very long string, you can:
X Enter it all on one line:
var myString = "This very long string might wrap onto a second line visually, but you
typed no CR character when entering it."
X
Enter on multiple lines, using a backslash (\) continuation character at the end of each line:
var myString = "This string spans \
two lines."
X
Use triple quotes around the entire string on multiple lines:
var myString = """This "quoted" word is inside the
multiline string enclosed by triple quotes."""
The triple-quote option allows the string to contain embedded quotes.
Searching in text
The Toolkit offers a search utility through the Edit > Find and Replace command. This command brings
up the Find and Replace panel. If the panel is not docked, you can hide it by pressing E
SC.
The Find and Replace panel allows you to search through multiple documents for text that matches a
specific search string or regular expression. You can choose to search in:
X The current document, or the current selection in the current document
X All open documents
Comentarios a estos manuales