Adobe 12040118 Using Help - Page 180
Replace text, general operation, which is the automatic editing of text layers. Quite simply
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 180 highlights
Help Using Help } // Return a boolean saying whether we added the effect return addedIt; } // Start an undo group. By using this with an endUndoGroup(), you // allow users to undo the whole script with one undo operation. app.beginUndoGroup("Apply Fast Blur to Selections"); // If we don't find any selected layers, we'll put up an alert at the end. var numLayersChanged = 0; // Get the active comp var activeItem = app.project.activeItem; if (activeItem != null && (activeItem instanceof CompItem)){ var activeComp = activeItem; // try to apply to every selected layer var selectedLayers = activeComp.selectedLayers; for (var i = 0; i < selectedLayers.length; i++) { var curLayer = selectedLayers[i]; // The method returns true if it adds the effect, false otherwise. if (applyFastBlurToLayer(curLayer) == t r ue) { numLayersChanged Print a message if no layers were affected if (numLayersChanged == 0) { a l e r t ( " P l e a s e s e l e c t a n AV l ayer o r l ayer s a n d r u n s c r i p t a g a i n " ) ; } app.endUndoGroup(); } Examples Back 180 Replace text This script performs an action much too specific to be useful as it is, but it shows the basics for a very useful general operation, which is the automatic editing of text layers. Quite simply, the script looks for selected text layers that contain the text string "blue" and changes this string to read "monday"--note that "blue" could appear anywhere in the selected layer, even as part of another word, and still be changed. For example, "bluejean" will read "mondayjean" after the effect is applied. The comments that appear on lines beginning with double forward slashes (//) describe what is occurring in each section of the script. The script does the following, in order: Using Help Back 180