Using The Document Info Object; Using History State Objects - Adobe 65048332 Manual

Scripting guide
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
AS
set kind of myChannel to selected area channel
VBS
channelRef.ind = 3 'for psSelectedAreaAlphaChannel
'from the constant value PsChannelType
JS
channelRef.kind = ChannelType.SELECTEDAREA

Using the Document Info object

In Photoshop, you can associate information with a document by choosing File > File Info.
To accomplish this task in a script, you use the
which is stored in the
demonstrate how to use the
document.
AS
set docInfoRef to info of current document
get EXIF of docInfoRef
set copyrighted of docInfoRef to copyrighted work
set owner url of docInfoRef to "http://www.adobe.com"
get EXIF of docInfoRef
VBS
Set docInfoRef = docRef.Info
docInfoRef.Copyrighted = 1 'for psCopyrightedWork
docInfoRef.OwnerUrl = "http://www.adobe.com"
JS
docInfoRef = docRef.info
docInfoRef.copyrighted = CopyrightedType.COPYRIGHTEDWORK
docInfoRef.ownerUrl = "http://www.adobe.com"
For information about other types of information (properties) you can associate with a document, look up
the following:
In the Adobe Photoshop CS5 AppleScript Scripting Reference or in the Photoshop AppleScript Dictionary,
look up the properties for the class
In the Adobe Photoshop CS5 Visual Basic Scripting Reference, the Adobe Photoshop CS5 JavaScript
Scripting Reference, the Visual Basic Object Browser or the ExtendScript Object Model Viewer, look up
the properties for the

Using history state objects

Photoshop keeps a history of the actions that affect documents. Each time you apply a change to an image
in the Photoshop application, you create a history state; you can access a document's history states from
the History palette by selecting Window > History. See Photoshop Help for additional information about
History State.
In a script, you can access a
property of the
state or to fill a
The following examples revert the document contained in the variable
properties it had when it was first opened or created. Using history states in this fashion gives you the
ability to undo modifications to the document.
(
/
info
Info
info
DocumentInfo
DocumentInfo
Document
object. You can use a
Document
object.
Selection
(
info-object
) property of the
Document
object to set the copyrighted status and owner URL of a
.
info-object
object.
object's history states using the
HistoryStates
Working with the Photoshop Object Model 47
DocumentInfo/DocumentInfo)
object. The following examples
HistoryStates
object to reset a document to a previous
back to the form and
docRef
object,
object, which is a

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

65048599Photoshop cs5

Table of Contents