Adobe 23101764 Scripting Guide - Page 45

Advanced Scripting

Page 45 highlights

Scripting Photoshop 3 Advanced Scripting 3.4 Advanced Scripting Having familiarized yourself with the basic "Hello, World!" script, you are now ready to move on to more advanced scripting techniques such as configuring document preferences, applying color to text items, and rasterizing text so that wrap an d blur processing can be applied to words. In this section, we describe sample code that takes you step-by-step through an extended script to successively produce the output illustrated below. 1 Document Preferences 2 Displaying Colored Text 3 Applying a Wave Filter 4 Applying a Blur Filter 3.4.1 Advanced JavaScript The following JavaScript code sample is broken down into four sections, the first of which deals with configuring document preferences. NOTE: In JavaScript, the Photoshop Application object is already created for you behind the scenes. You do not have to make an explicit object reference to it. Photoshop CS Scripting Guide 41

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105

Photoshop CS Scripting Guide
41
Scripting Photoshop
Advanced Scripting
3
3.4 Advanced Scripting
Having familiarized yourself with the basic "Hello, World!" script, you are now ready to move
on to more advanced scripting techniques such as con
guring document preferences, applying
color to text items, and rasterizing text so that
wrap
an d
blur
processing can be applied to
words.
In this section, we describe sample code that takes you step-by-step through an extended script
to successively produce the output illustrated below.
3.4.1
Advanced JavaScript
The following JavaScript code sample is broken down into four sections, the
rst of which
deals with con
guring document preferences.
N
OTE
:
In JavaScript, the Photoshop Application object is already created for you behind the
scenes. You do not have to make an explicit object reference to it.
1 Document Preferences
2 Displaying Colored Text
4 Applying a Blur Filter
3 Applying a Wave Filter