Adobe 12040118 - After Effects Standard Using Manual page 184

Using help
Hide thumbs Also See for 12040118 - After Effects Standard:
Table of Contents

Advertisement

Help
Using Help
if (incrementer < 100) {
ist r ing = " 0" + i st r in g ;
}
Finally we create a new file using our updated name and extension, display an alert letting the user know the
new file name being saved, and save the project with the new file name.
var newFi le = File (cu r rFile .pa th + " / " + c u r rF ileName + " _ " + ist r i ng + ex t);
ale r t(newFile. fsNa me );
app.pro ject. save (n ew File );
}
Render named items
This script allows you to find compositions in the open project with a particular text string in their names and
send all such compositions to the Render Queue.
To start, we check to see if a default string for rendering has already been set in the user preferences. If so, we
set this as a user prompt, handy if you're always looking for the same string (for example, "FINAL" or
"CURRENT"). If not, we set a new sectionName and keyName for the preferences file along with a placeholder
value for the string that will be entered by the user.
v a r s e c t i o n Na m e = " A E E x a m p l e S c r i p t s " ;
var ke yName = "Render comps w ith this st r ing";
v a r s e a rch S t r i n g = " " ;
i f ( a p p. s e t t i n g s . h aveS e t t i n g ( s e c t i o n Na m e , ke y Na m e ) ) {
s e a rch S t r i n g = a p p. s e t t i n g s . g e t S e t t i n g ( s e c t i o n Na m e , ke y Na m e ) ;
}
Now we display a prompt to the user asking for what text string we should use.
searchSt r ing = prompt("What st r ing to render?", searchSt r ing);
We next go through the project looking for the text entered by the user, and seeing if the item that contains
that text is a composition, sending all compositions with that text string in their names to the Render Queue.
If the user cancels, the text is undefined. Otherwise, we save the new setting in preferences, convert it to all
lowercase letters for consistency's sake (keeping in mind that the search will not be case sensitive).
if ( searchSt r in g ) {
a p p. s e t t i n g s . s aveS e t t i n g ( s e c t i o n Na m e , ke y Na m e , s e a rch S t r i n g ) ;
searchSt r ing = searchSt r ing .toLowerCase();
for (i = 1; i <= app. project.numItems; ++i) {
var curItem = app. project.item(i);
if (curItem i n sta n ceo f CompItem ) {
if (curItem.name.toLowerCase().indexOf(searchSt r ing) != -1) {
app. project.renderQueue.items.add(curItem);
}
}
}
Using Help
Examples
Back
184
Back
184

Advertisement

Table of Contents
loading

This manual is also suitable for:

After effects

Table of Contents