Thanks all. I shall look into the suggestions. HEre's what I'm trying to do. I'm creating HTML 5 banners, and need to inject code for the click tags.
The code looks like this, <!DOCTYPE html> <!-- NOTES: 1. All tokens are represented by '$' sign in the template. 2. You can write your code only wherever mentioned. 3. All occurrences of existing tokens will be replaced by their appropriate values. 4. Blank lines will be removed automatically. 5. Remove unnecessary comments before creating your template. --> <html> <head> <meta charset="UTF-8"> <meta name="authoring-tool" content="Adobe_Animate_CC"> <title>BusSum22 P2 LB728x90 D1</title> <!-- write your code here --> <script src="https://code.createjs.com/1.0.0/createjs.min.js"></script> <script src="BusSum22 P2 LB728x90 D1.js?1636109472417"></script> <script> var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation; function init() { canvas = document.getElementById("canvas"); anim_container = document.getElementById("animation_container"); dom_overlay_container = document.getElementById("dom_overlay_container"); var comp=AdobeAn.getComposition("82825A3F9EA349F399DB9BAF8ABCE77F"); var lib=comp.getLibrary(); handleComplete({},comp); } function handleComplete(evt,comp) { //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage. var lib=comp.getLibrary(); var ss=comp.getSpriteSheet(); exportRoot = new lib.BusSum22P2LB728x90D1(); stage = new lib.Stage(canvas); //Registers the "tick" event listener. fnStartAnimation = function() { stage.addChild(exportRoot); createjs.Ticker.framerate = lib.properties.fps; createjs.Ticker.addEventListener("tick", stage); } //Code to support hidpi screens and responsive scaling. AdobeAn.makeResponsive(false,'both',false,1,[canvas,anim_container,dom_overlay_container]); AdobeAn.compositionLoaded(lib.properties.id); fnStartAnimation(); } </script> <!-- write your code here --> </head> <body onload="init();" style="margin:0px;"> <div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:728px; height:90px"> <canvas id="canvas" width="728" height="90" style="position: absolute; display: block; background-color:rgba(255, 255, 255, 1.00);"></canvas> <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:728px; height:90px; position: absolute; left: 0px; top: 0px; display: block;"> </div> </div> </body> </html> *And I need to injects bits in red* <!DOCTYPE html> <!-- NOTES: 1. All tokens are represented by '$' sign in the template. 2. You can write your code only wherever mentioned. 3. All occurrences of existing tokens will be replaced by their appropriate values. 4. Blank lines will be removed automatically. 5. Remove unnecessary comments before creating your template. --> <html> <head> *<meta name="ad.size" content="width=728,height=90">* *<script type="text/javascript">* *var clickTag = "XXXXXXXXX"; </script>* <meta charset="UTF-8"> <meta name="authoring-tool" content="Adobe_Animate_CC"> <title>BusSum22 P2 LB728x90 D1</title> <!-- write your code here --> <script src="https://code.createjs.com/1.0.0/createjs.min.js"></script> <script src="BusSum22 P2 LB728x90 D1.js?1636109472417"></script> <script> var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation; function init() { canvas = document.getElementById("canvas"); anim_container = document.getElementById("animation_container"); dom_overlay_container = document.getElementById("dom_overlay_container"); var comp=AdobeAn.getComposition("82825A3F9EA349F399DB9BAF8ABCE77F"); var lib=comp.getLibrary(); handleComplete({},comp); } function handleComplete(evt,comp) { //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage. var lib=comp.getLibrary(); var ss=comp.getSpriteSheet(); exportRoot = new lib.BusSum22P2LB728x90D1(); stage = new lib.Stage(canvas); //Registers the "tick" event listener. fnStartAnimation = function() { stage.addChild(exportRoot); createjs.Ticker.framerate = lib.properties.fps; createjs.Ticker.addEventListener("tick", stage); } //Code to support hidpi screens and responsive scaling. AdobeAn.makeResponsive(false,'both',false,1,[canvas,anim_container,dom_overlay_container]); AdobeAn.compositionLoaded(lib.properties.id); fnStartAnimation(); } </script> <!-- write your code here --> </head> <body onload="init();" style="margin:0px;"> <div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:728px; height:90px"> *<a href="javascript:window.open(window.clickTag)">*<canvas id="canvas" width="728" height="90" style="position: absolute; display: block; background-color:rgba(255, 255, 255, 1.00);"></canvas>*</a>* <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:728px; height:90px; position: absolute; left: 0px; top: 0px; display: block;"> </div> </div> </body> </html> On Saturday, 6 November 2021 at 12:59:53 pm UTC+10 [email protected] wrote: > On Nov 05, 2021, at 06:00, Pu Koh <[email protected]> wrote: > > > Is there a function to run multiple find and replace patterns instead of > doing it one at a time? > > ------------------------------ > > Hey There, > > Personally I would most often use a Text Filter and a little Perl, > although it depends upon the context. (See appended script. See “Text > Filter” in the manual if you don't know how to use them.) > > NOTE: JJ's example text's tab separators got turned into spaces by the > web. (At least in Apple Mail.) > > Canon files can be a bit confusing, until you've used them a few times – > but they can be very useful. > > As Bruce suggested – a Text Factory is also a perfectly viable option. > > > -- > Best Regards, > Chris > > ------------------------------ > > #!/usr/bin/env perl -sw > > while (<>) { > s/\bnuts\b/NUTS!/g; > s/\bgoofy\b/GOOFY!/g; > print; > } > > ------------------------------ > > Sample Text: > > ------------------------------ > > nuts are pretty nutty nuts > nutso > > goof > goofy is as goofy does. > > ------------------------------ > > -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/8770f3dc-3972-4e46-b147-2a9f8aedba76n%40googlegroups.com.
