Adobe 12040118 Using Help - Page 184
Render named items, To start
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 184 highlights
Help Using Help Examples Back 184 if (incrementer < 100) { istring = "0" + istring; } 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 newFile = File(currFile.path + "/" + currFileName + "_" + istring + ext); alert(newFile.fsName); app.project.save(newFile); } 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. var sectionName = "AE Example Scripts"; var keyName = "Render comps with this string"; var searchString = ""; if (app.settings.haveSetting(sectionName, keyName)) { searchString = app.settings.getSetting(sectionName, keyName); } Now we display a prompt to the user asking for what text string we should use. searchString = prompt("What string to render?", searchString); 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 (searchString) { app.settings.saveSetting(sectionName, keyName, searchString); searchString = searchString.toLowerCase(); for (i = 1; i