Adobe 23101764 - Photoshop CS - PC Manual page 87

Scripting guide
Hide thumbs Also See for 23101764 - Photoshop CS - PC:
Table of Contents

Advertisement

VB:
Dim appRef As New Photoshop.Application
'remember unit settings; and set to values expected by this script
Dim originalRulerUnits As Photoshop.PsUnits
originalRulerUnits = appRef.Preferences.RulerUnits
appRef.Preferences.RulerUnits = psPixels
'get selection and replace it
Dim docRef As Photoshop.Document
Set docRef = appRef.ActiveDocument
docRef.Selection.Select Array(Array(50, 60), Array(150, 60), _
'restore unit setting
appRef.Preferences.RulerUnits = originalRulerUnits
JS:
// remember unit settings; and set to values expected by this
// script
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
//get selection and replace it;
app.activeDocument.selection.select (new Array(new Array(60, 10),
// restore unit setting
app.preferences.rulerUnits = originalRulerUnits;
Photoshop CS Scripting Guide
Array(150, 120), Array(50, 120)), Type:=psReplaceSelection
new Array(100, 10), new Array(100, 100), new Array(60, 100)),
SelectionType.REPLACE);
Scripting Photoshop
Selections
3
83

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs

Table of Contents