Using Long Script Lines; Creating A Sample Hello World Script - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
Note:
Generally, your scripts are easier to read if you format all comments as single-line comments
because the comment status of the line is indicated at the beginning of the line.
VBS
In VBScript, enter a single straight quote ( ' ) to the left of the comment.
' this is a comment
Dim thisString ' this is an end-of-line comment
Note:
VBScript does not support multi-line comments. To comment out more than one line, begin each
line with a single straight quote.
JS
In JavaScript, use the double forward slash to comment a single or partial line:
// This comments until the end of the line
var thisString = "Hello, World" // this comments until the end of the line as well
Enclose multi-line comments in the following notation /* */.
/* This entire
block of text
is a comment*/
Note:
Generally, your scripts are easier to read if you format all comments as single-line comments
because the comment status of the line is indicated at the beginning of the line.

Using Long Script Lines

In some cases, individual script lines are too long to fit on a single line in your script editor window.
AS
AppleScript uses the special character (¬) to show that the line continues to the next line.
This continuation character denotes a "soft return" in the script. Press Option-Return to type the character.
VBS
In VBScript, use a space followed by an underscore ( _).
JS
JavaScript does not require a line continuation character. When an individual statement is long to fit on a
single line, the next line simply wraps to the following line. However, to make your script easier to read,
you can use the space bar or Tab to indent the continuation line.
Note:
You can put more than one JavaScript statement on a single line if you separate the statements with
a semicolon (
Here is an example of putting two statements on a single line:

Creating a Sample Hello World Script

It's time to put the scripting concepts you've just learned into practice. Traditionally, the first thing to
accomplish in any programming environment is the display of a "Hello World" message.
). However, your scripts are easier to read if you start a new line for each statement.
;
var thisNumber= 10; var thisString = "Hello, World"
Photoshop CS2
Scripting basics
21

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PHOTOSHOP CS 2.0 - SCRIPTING GUIDE and is the answer not in the manual?

This manual is also suitable for:

Photoshop cs2

Table of Contents