Adobe 65009963 Scripting Guide - Page 175

Render and e-mail, Convert selected properties to markers, Creative Suite 3 JavaScript Tools Guide

Page 175 highlights

Examples Render and e-mail 175 files to save processing time. If no match is found for a number string, assumes there is no image sequence and checks for an array consisting of the matched string and its location within the file name. If all files are part of a numbered sequence, assumes a sequence and returns the first file of that sequence. • Defines a helper function to pop up error dialog boxes if there is a problem with any file we are attempting to import. • Defines a helper function to actually import any image sequence discovered using testForSequence(). There is an option for forcing alphabetical order in sequences, which is commented out in the script as written. If you want to force alphabetical order, uncomment the line importOptions.forceAlphabetical = true. • Calls the main function, processFolder(). Render and e-mail This script, render_and_email.jsx, renders all queued items in an open project and sends an e-mail report to indicate when the render has completed. It makes use of two other scripts that follow, email_methods.jsx (to send the e-mail properly) and email_setup.jsx (which establishes the sender, recipient, and e-mail server). This script does the following: • Establishes conditions under which the script will run. An open project with at least one item queued is required. • Checks whether e-mail settings are already saved in the preferences. If not, run the email_setup.jsx script, which prompts the user for the mail gateway and sender and recipient addresses. (If there are saved settings that you need to change, you can always run the script to make new settings that overwrite the existing ones.) • Render the items in the render queue. • When rendering is complete, creates a text string for the e-mail message that contains the start time of the render, the render time of each item in the queue, and the total render time. • E-mails the message, using the settings (such as the server) from the email_methods.jsx script • Displays an error if for any reason it is unable to send the mail. A helper script, email_meth ods. jsx , creates an e-mail object, using the ExtendScript Socket object. For details of that utility, see the Creative Suite 3 JavaScript Tools Guide. Another helper script, email_setup.jsx, prompts the user for the server name, e-mail sender, and e-mail recipient that are saved as Settings. You can run this script as standalone any time you want to change the settings. This script is a good example of how to create settings that are saved in preferences for the sole use of scripting (as opposed to altering existing After Effects preferences settings). Convert selected properties to markers This script, Convert Selected Properties to Markers.jsx, goes through the properties in each layer that are currently selected in the Timeline panel, and converts the value of each property at each frame time to a Flash Video event cue point in a marker. 175

  • 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
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193

175
Examples
Render and e-mail
175
files to save processing time.
If no match is found for a number string, assumes there is no image sequence and checks for an array
consisting of the matched string and its location within the file name.
If all files are part of a numbered sequence, assumes a sequence and returns the first file of that sequence.
Defines a helper function to pop up error dialog boxes if there is a problem with any file we are attempting
to import.
Defines a helper function to actually import any image sequence discovered using
testForSequence()
.
There is an option for forcing alphabetical order in sequences, which is commented out in the script as
written. If you want to force alphabetical order, uncomment the line
importOptions.forceAlphabetical =
true
.
Calls the main function,
processFolder()
.
Render and e-mail
This script,
render_and_email.jsx
, renders all queued items in an open project and sends an e-mail report to
indicate when the render has completed. It makes use of two other scripts that follow,
email_methods.jsx
(to
send the e-mail properly) and
email_setup.jsx
(which establishes the sender, recipient, and e-mail server).
This script does the following:
Establishes conditions under which the script will run. An open project with at least one item queued is
required.
Checks whether e-mail settings are already saved in the preferences. If not, run the
email_setup.jsx
script,
which prompts the user for the mail gateway and sender and recipient addresses. (If there are saved settings
that you need to change, you can always run the script to make new settings that overwrite the existing
ones.)
Render the items in the render queue.
When rendering is complete, creates a text string for the e-mail message that contains the start time of the
render, the render time of each item in the queue, and the total render time.
E-mails the message, using the settings (such as the server) from the
email_methods.jsx
script
Displays an error if for any reason it is unable to send the mail.
A helper script,
email_methods.jsx
, creates an e-mail object, using the ExtendScript Socket object. For details
of that utility, see the
Creative Suite 3 JavaScript Tools Guide
.
Another helper script,
email_setup.jsx
, prompts the user for the server name, e-mail sender, and e-mail
recipient that are saved as Settings. You can run this script as standalone any time you want to change the
settings. This script is a good example of how to create settings that are saved in preferences for the sole use of
scripting (as opposed to altering existing After Effects preferences settings).
Convert selected properties to markers
This script,
Convert Selected Properties to Markers.jsx
, goes through the properties in each layer that are
currently selected in the Timeline panel, and converts the value of each property at each frame time to a Flash
Video event cue point in a marker.