Adobe photoshop cs 2.0 Betriebsanweisung

Seite von 91
Photoshop CS2
Adobe Photoshop CS2  Scripting Guide
 Scripting basics     34
VBS
Private Sub Command1_Click()
' Store a reference to the document with the name "My Document"
' If the document does not exist, display an error message.
    Dim appRef As New Photoshop.Application
    Dim docRef As Photoshop.Document
    Dim errorMessage As String
    Dim docName As String
    docName = "My Document"
    Set docRef = appRef.ActiveDocument
    On Error GoTo DisplayError
        Set docRef = appRef.Documents(docName)
        Alert  "Document Found!"
    Exit Sub
DisplayError:
    errorMessage = "Couldn't locate document " & "'" & docName & "'"
    Alert  errorMessage
End Sub
JS
try
{
for (i = 0; i < app.documents.length; ++i)
{
var myName = app.documents[i].name;
alert(myName)
}
}
catch(someError)
{
alert( "JavaScript error occurred. Message = " +
someError.description)
}
Bibliography
AS
For further information and instruction in using the AppleScript scripting language, see these documents 
and resources:
“AppleScript for the Internet: Visual QuickStart Guide,” 1st ed., Ethan Wilde, Peachpit Press, 1998. ISBN 
0-201-35359-8.
“AppleScript Language Guide: English Dialect,” 1st ed., Apple Computer, Inc., Addison-Wesley 
Publishing Co., 1993. ISBN 0-201-40735-3.
“Danny Goodman’s AppleScript Handbook,” 2nd ed., Danny Goodman, iUniverse, 1998. ISBN 
0-966-55141-9.
Apple Computer, Inc. AppleScript website: