How to add lines to the PresetEffects.xml from a script

Hi, I would like to add a few lines in the PresetEffects.xml to another text file or an another JavaScript add lines like this how can I do? :

< name of the group = "$$$ / AE/Preset/AnimalHead14 / = mouth" >

< name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthOffsetX = mouth X shift" default = '0' valid_min = '-30,000"valid_max ="30000"slider_min = slider_max"-500"= '500' precision ="1"DISPLAY_PERCENT ="true"/ >"

< name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthOffsetY = mouth Offset Y" default = "0" valid_min = "-30,000" valid_max = "30000" slider_min = slider_max "-500" = '500' precision = "1" DISPLAY_PERCENT = "true" / > "

< name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthScaleWidth = scale Overture" default = "100" valid_min = "-30,000" valid_max = "30000" slider_min = slider_max '-500' = '500' precision = "1" DISPLAY_PERCENT = "true" / > "

< name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthScaleHeight = scale of mouth height" default = "100" valid_min = "-30,000" valid_max = "30000" slider_min = "-500" slider_max = "500" precision = "1" DISPLAY_PERCENT = "true" / > "

< / Group >

< / effect >

{function onClick.btn

Add the lines of my text file in the PresetEffects.xml

I did once, like this:

var scriptEffect = {};
scriptEffect.xml =

    
        
        
    
    
        
        
        
    
;
scriptEffect.matchName = [email protected]();

function installScriptEffect(){

    var ret;
    var file = new File(Folder.appPackage.absoluteURI + "/PresetEffects.xml");
    var str, idx, header, xml;
    var xmlSettings = XML.settings();

    XML.setSettings(XML.defaultSettings());

    try{
        if (!file.exists) throw "ERR_FILE_NOT_FOUND";

        file.open("r");
        str = file.read();
        file.close();

        idx = str.indexOf("");
        if (idx<0) throw "???";

        header = str.substring(0, idx-1);
        xml = new XML(str.substring(idx, str.length));

        if (!xml.contains(scriptEffect.xml)){
            xml.appendChild(scriptEffect.xml);
            if (!file.copy(new File(file.absoluteURI+".bak"))) throw "ERR_CANNOT_WRITE";
            file.open("w");
            if (!file.write(header + xml.toXMLString())) {file.close(); throw "ERR_WRITE_FAILED";};
            file.close();
            alert("Preset installed succesfully. Please restart After Effects");
            }
        else{
            alert("Preset already installed. You need to restart After Effects to make it effective.");
            };
        ret = true;
        }
    catch(e){
        file.close();
        alert(e);
        ret = false;
        };

    XML.setSettings(xmlSettings);

    return ret;
    };

Then, when you want to add the effect, check with myLayer.effect.canAddProperty (scriptEffect.matchName).

If true, nothing to do, otherwise use the installScriptEffect function. Normally, it works (haven't tried for a long time).

Xavier

Tags: After Effects

Similar Questions

  • How to add tags in the existing XML file?

    Hello
    I have a requirement in which I need to add a tag to the existing xml data.

    For example:
    < ROW >
    < EVNT_ID > 7333976 < / EVNT_ID >
    < DISTRCT_CD > 67 < / DISTRCT_CD >
    < TIME_OFF > 6 May 2008 10:50:04 < / TIME_OFF >
    < / ROW >

    The desired output is,

    < DI_DATA >
    < ROW >
    < EVNT_ID > 7333976 < / EVNT_ID >
    < DISTRCT_CD > 67 < / DISTRCT_CD >
    < TIME_OFF > 6 May 2008 10:50:04 < / TIME_OFF >
    < / ROW >
    < / DI_DATA >

    I must add < DI_DATA > < / DI_DATA > at the beginning and end of the entry.

    Anyone of you could help me with that?

    Thank you
    GV

    If your XML is just in a CLOB, you can just use manipulation of strings to add/add nodes on. If you have it in an XMLType you could just do the following

    select appendchildxml(XMLTYPE(''),
                                  'DI_DATA',
                                  XMLTYPE('
    7333976
    67
    06-May-2008 10:50:04 AM
    '))  -- this would be your variable
      from dual;
    

    which will put your data in the DI_DATA node.

  • Is it a good idea to add predefined effects using presetEffects.xml?

    Hello

    I am currently working on a plugin using scriptUI.
    One thing I do is add a control null, which have many options for expressions.

    My basic problem is I want to sort them into groups for better ergonomics. The only way I found to do this, add some excerpts to presetEffects.xml. (please tell me if you know another way)

    Presents all works. So great. But now, I think, is it really a good idea? My main concern is: will they stay there? When the user is updating to a newer version of AE they are replaced?

    Y at - it other problems, that I should be aware?

    Thank you
    Jakob

    If you would not add new effects to null-controller, I think that the best way to organize things, is to create custom predefined ( you can use this script )

    store as a binary file inside your script, and then apply this preset.

  • How to add bookmarks to the IE Favorites list?

    How to add bookmarks to the IE Favorites list? I can find them on recently added bookmarks, but they are not listed when I click on IE Favorites.

    Firefox bookmarks are stored in your Firefox profile folder, they are not synchronized with the IE Favorites.

  • How to add programs to the start of the file using Vista

    How to add programs to the start of the file using Vista

    Hi Harry,.

    Oddly enough, you can actually do it in msconfig except if it is already there and simply not checked as opposed to not being do not at all (although you would think that they would understand this option).

    The easiest way is to add the program (or a shortcut to the program) in the folder all Menu Programs Startup.   Here is the procedure: http://www.ehow.com/how_5098465_add-startup-programs.html.  Remember, to do this, you must either a shortcut existing (perhaps on the desktop or elsewhere in the menu all programs) or you need to find the source file (probably somewhere in C:\Program Files depending on what you want to add) and either copy it and add it to the startup folder or right-click on it and create a shortcut to copy into the startup folder.  Once you reboot, this program starts during the initial commissioning process and you will now be able to control using msconfig.exe, if you wish.

    Another option is to do this by using the registry editor.  If you decide to try this, first create a restore AND system restoration point backup of the registry before you begin.  Here is the procedure: http://www.ehow.com/how_7304438_add-program-msconfig-regedit.html.  I recommend to use this ONLY if the previous procedure does not work for some reason any as long as that the procedure is simpler and safer.

    If you want a simpler way to manage and control startup programs, you can try it free WinPatrol http://www.winpatrol.com/download.html that change monitors for startup programs if you set it to run in real-time so that you know when to try new programs are added to your Start menu and, for the purposes of this question includes an Add button which opens a link to a window of Windows Explorer where you can browse the program you want to add, click open to select and then add it directly to the commissioning.  If you prefer it does not work all the time, you can simply uncheck the box which includes this program and it will work only when you choose to run (but at the start, will work as an indication otherwise or configured).  It will appear not in the start menu in all programs (Finally, WinPatrol is, but not programs, it adds to the start), but it will appear in WinPatrol (which also lets you manage what you want or not start with checkboxes as in msconfig) and sure in msconfig - but only after a reboot is complete the process of adding.

    I hope this helps.  Personally, I use WinPatrol myself and let it run in real time.  Since I do a lot of installations, it helped me often prevent the addition of a startup item I haven't really need and reduces how many times I actually need to check what is happening out there.

    If this answers your question without the need to repost in another forum, please mark it as an answer.  If this isn't the case, then of course you must republish as suggested above.

    Good luck!

  • How to add text to the file selected?

    I have already updated title but I don't know how to add it to the selected real file (the one in the middle)... I read on some other forums but its still confuse me.  Also, is there anyway to add the effect of movement, as drag in or dissolve almost?

    Screen Shot 2016-02-19 at 10.27.40 PM.png

    I mean this in the nicest way possible, but it's very wacky workspace you put in place there. Create titles is muuuuch easier in the standard workspace Edition. When you create / open a title in the editing workspace, he creates a floating large window with the title of all the members of panels. It is about the only time I am ok with windows in the first floating. You will create the title in the window title, and then close the window title entirely. The video for the title will then be in your project Panel (which you can not common to see in your current workspace configuration, but will be very apparent in the workspace standard edition in the lower left). So the best thing to do is to simply drag the title element of the project to sequence Panel (another Panel today, you don't see in your current workspace arrangement.

  • I want to print PostScript in illustrator, then put the Distiller how to add print on the list?

    I want to print PostScript in illustrator, then put the Distiller how to add print on the list?

    What exactly do you want to do it is not possbile to save to the PDF format?

  • How to add licenses in the VIP administration Console

    How to add licenses in the VIP Admin console?

    Hello

    Please see: -.

    Manage your cloud of Adobe Creative for the composition of teams

    Adobe Creative Cloud for teams FAQ

  • Cannot figure out how to "add-in" for the 2013 Outlook application... said the loading behavior is not loaded. How can I fix it?

    Cannot figure out how to "add-in" for the 2013 Outlook application... said the loading behavior is not loaded. How can I fix it?

    Hi amandab9126792,

    2013 Outlook does not work with Acrobat X because they are not compatible. Please check the compatibility to https://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html.

    Kind regards

    Nicos

  • How to add text to the gif format

    Hello, I am a beginner in photoshop.

    I want to add text to my gif as part of the animation, but somehow the text transparent look, even though I already use black color for the text.

    Could someone give me tutorial how to add text to the gif and then do some sort of subtitle?

    Thank you...

    The text layer is 2 layers under the real background layer in your file. Check your layers panel. Click, drag and drop the text layer currently selected in your layers 2 screenshot above or the visible layers, especially to see if your text will appear - it should ideally.

    Settings - when save you for Web & devices, you can customize options preset for GIF on the top right of your dialog "save for Web & devices".

  • How to add text to the Notes?

    Hi all

    I want to add some text in the notes. I create notes with success.

    My note label and name are not apply any script executed successfully.

    How to add text to the note? My script is:

    indesign #target

    myDocument var = app.documents.add ();

    var myTextFrame = myDocument.pages.item (0).textFrames.add ();

    myTextFrame.geometricBounds is ['10', 15 ' p', '50 p', '50 p'];.

    myTextFrame.contents = "Adobe Indesign";

    var insertionPoint = myTextFrame.insertionPoints.item (-1);

    var note = insertionPoint.notes.add (1433299822);

    Note.label = "NewNote";

    Note. Name = "FirstNote";

    Thank you

    Jin

    try sth. like

    Note.texts [0] .silence = 'some content '.

    Hans-Gerd Classen'

  • Add lines to the query result?

    Is it possible to add lines to the result of a shutdown of the SQL query, similar to the CALCULATION command in SQL * more?

    In other words, for example, when A column value changes, add a line after the previous line (the last one before changing the column A) to display the sum of the values in column B.

    for example

    < PRE > A and B
    - --
    1 3
    1 4
    1 5
    12
    2 9
    2 1
    2-7
    1 < / PRE >
    SQL> create table sales (person,city,sales)
      2  as
      3  select 'Alice', 'Phoenix', 19 from dual union all
      4  select 'Alice', 'Tulsa', 11 from dual union all
      5  select 'Bob', 'Phoenix', 17 from dual union all
      6  select 'Bob', 'Tulsa', 9 from dual union all
      7  select 'Tony', 'Miami', 5 from dual union all
      8  select 'Tony', 'San Francisco', 4 from dual union all
      9  select 'Tony', 'San Francisco', 3 from dual
     10  /
    
    Tabel is aangemaakt.
    
    SQL> select case grouping_id(person,city,rowid)
      2         when 1 then 'Sub-Total for'
      3         when 3 then 'Sub-Total for'
      4         when 7 then 'Grand Total'
      5         end notes
      6       , person
      7       , city
      8       , sum(sales) sales
      9    from sales
     10   group by rollup(person,city,rowid)
     11  having grouping_id(city,rowid) != 1
     12      or count(*) > 1
     13   order by person
     14       , city
     15       , grouping(rowid)
     16  /
    
    NOTES         PERSO CITY               SALES
    ------------- ----- ------------- ----------
                  Alice Phoenix               19
                  Alice Tulsa                 11
    Sub-Total for Alice                       30
                  Bob   Phoenix               17
                  Bob   Tulsa                  9
    Sub-Total for Bob                         26
                  Tony  Miami                  5
                  Tony  San Francisco          4
                  Tony  San Francisco          3
    Sub-Total for Tony  San Francisco          7
    Sub-Total for Tony                        12
    Grand Total                               68
    
    12 rijen zijn geselecteerd.
    

    Kind regards
    Rob.

  • RE: iOS iPhone 6 s 10 how l remove or disable the slippery camera from outside the locked screen? This feature is a security and threat privacy for me.

    RE: iOS iPhone 6 s 10 how l remove or disable the slippery camera from outside the locked screen? This feature is a security and threat privacy for me.

    You can not. However, I'm not sure why you think it's a privacy or security threat. The only thing that can be accessed without unlocking the phone is the camera to take pictures. No one can access your data already on the phone.

    You can send feedback to Apple here:

    http://www.Apple.com/feedback

  • How to add lines of text information in the settings?

    Guys,

    I'm trying to customize a few things about Motion 5 and really I was wondering how to add these lines of text in the settings?

    Tried to google it, but without success.

    I think you need to learn how * write * FxPlug effects plugins. You cannot add these labels/buttons on the move as it is. What I usually do, is create a platform > pop up widget and use remove the "Snapshot" texts... "(and usually replace it with a series of quadratins (---) to create a line of separation.) To help you, you must have a 'sex' you can show/hide with opacity (and a rig box) which displays the help text.

  • How to 'Allow smoothing' for the loaded XML .jpg?

    I have a thumb wheel image that loads a bunch of jpg. They are be enlarged rollover in 1,05.

    I've seen pixelated at scale 1 x 1 as well as expanded.

    I'm happy prettey how Flash renders the images with "Allow smoothing" on.

    How would I do it for the loaded xml jpg? Would it be as a script in the main folder or in the xml file?

    Here's how to load images in AS3:

    function completeHandler_AppPopUps(e:Event):void{
              //trace("thumbnail complete "+e.target.loader.parent.parent.name)//tells us when the loading is complete
    
              //size image into scroller (need only if I will have images at different sizes)
              resizeMe(e.target.loader.parent, 60, 90, true, true, false);
    
              TweenMax.to(e.target.loader.parent.parent, .5, {alpha:.7});//makes all thumb images at alpha=.7 after they are fully loaded
              //Tweener.addTween(e.target.loader.parent.parent, { alpha:1, time: .5 } );//caurina version
    
              TweenMax.to(e.target.loader.parent.parent, .5, {colorMatrixFilter:{contrast:1.1, brightness: .7, saturation: .5}});//makes all thumb images at brightness:0.5 after they are fully loaded
    
    
    }
    
    

    I don't want to complicate things more than necessary, but just in case it's needed here is the complete code for the edification of the wheel section:

    /////Parse XML
    //build scroller from xml
    function buildScroller(imageList:XMLList):void{
              trace("build Scroller");
    
              for (var item:uint = 0; item<imageList.length();item++) {
                        var thisOne:MovieClip = new MovieClip();
    
                        //outline
                         var blackBox:Sprite = new Sprite();
                        blackBox.graphics.beginFill(0xFFFFFF);
                        blackBox.graphics.drawRect(-1, -1, 62, 92);//-1,-1 places rectangle 1px left and up.62, 92 draws rectangle 1px wider on all sides of placed image dimenstions of 60x90
                        blackBox.alpha = thumbFadeOut;//setting Border Tweens
                        thisOne.addChild(blackBox);
                        thisOne.blackBox = blackBox;//setting Border Tweens
    
                          thisOne.x = thisOne.myx = (60 + padding) *item;//replaces the line above for scale tweenw roll over calculation. "myx" is a made up term which defines the position. 61 is the width of the thumb
                        thisOne.itemNum = item;
                        thisOne.title = imageList[item].attribute("title");
                        thisOne.link = imageList[item].attribute("url");
                        thisOne.src = imageList[item].attribute("src");
                        thisOne.alpha = 0;//makes all thumb images at alpha=0 before they are fully loaded
    
                        //Loading and Adding the Images
                        //image container
                        var thisThumb:MovieClip = new MovieClip();
                        //add image
                        var ldr:Loader = new Loader();
                        //var url:String = imageList[item].attribute("src");
                        var urlReq:URLRequest = new URLRequest(thisOne.src);
                        trace("loading thumbnail "+item+" into Scroller: " + thisOne.src);//url
                        ldr.load(urlReq);
                        //assign event listeners for Loader
                        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler_AppPopUps);//tells us when the loading is complete
                        ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler_AppPopUps);//tells us if there are any typo errors when the loading is complete
                        thisThumb.addChild(ldr);
                        thisOne.addChild(thisThumb);
    
                        //create listeners for this thumb
                        thisOne.buttonMode = true;//makes boxes act as buttons
                        thisOne.addEventListener(MouseEvent.CLICK, clickScrollerItem_AppPopUps);//makes boxes act as buttons
                        thisOne.addEventListener(MouseEvent.MOUSE_OVER, overScrollerItem_AppPopUps);//traces the title when the mouse is over the bounding box in the Output Panel
                        thisOne.addEventListener(MouseEvent.MOUSE_OUT, outScrollerItem_AppPopUps);//traces the title when the mouse is out the bounding box in the Output Panel
    
    
    
                        //add item
                        scroller.addChild(thisOne);
              }
              scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);//adding movement on mouse position
              trace("termination of build scroller");
    
    }
    
    
    

    in your listener to full charge, enable the property smoothing to the content of your charger (expressed as a bitmap).

    function completeHandler_AppPopUps(e:Event):void{

    Bitmap(e.currentTarget.loader.content).smoothing=true;
              //trace("thumbnail complete "+e.target.loader.parent.parent.name)//tells us when the loading is complete

    //size image into scroller (need only if I will have images at different sizes)
              resizeMe(e.target.loader.parent, 60, 90, true, true, false);

    TweenMax.to(e.target.loader.parent.parent, .5, {alpha:.7});//makes all thumb images at alpha=.7 after they are fully loaded
              //Tweener.addTween(e.target.loader.parent.parent, { alpha:1, time: .5 } );//caurina version

    TweenMax.to(e.target.loader.parent.parent, .5, {colorMatrixFilter:{contrast:1.1, brightness: .7, saturation: .5}});//makes all thumb images at brightness:0.5 after they are fully loaded

    }

Maybe you are looking for