Setting a value to kill a script

I'm working on my first script and I hit a bit of a snag.

I added an expression of slider to a layer which I later add an expression.  (This part works)  The first two lines in the following code work as expected.  Line one creates the effect cursor and line two changes the name of the effect to the layer name what it controls.

Third line aimed to set the value of the cursor, but if this line is left in the script, the script simply stop at this moment, out of the loop for that is the code.  As near as I can tell, I'm trying to set a value to a ReadOnly property, but I don't know what size I should work with.  I guess that featherCrtl.property (1) is the value of the slider... Maybe it's not.  But I don't know what else would be the value.

Any help would be greatly appreciated.

Thank you

Lars

var featherCrtl = selectedLayers[i].property("Effects").addProperty("ADBE Slider Control"); 
featherCrtl.name = selectedLayers[i].name + " Feather Control"; 
featherCrtl.property(1).setValue(myFeather); 

Yes, it's because when you add an effect to a layer, any reference to existing effects gets invalidated (some for maks, etc, IE everything that can be added).

So when you add the "opacityCrtl", the defined variable previously 'featherCrtl' is no longer valid. You need to redefine, or do what you did, simply referring to the effect by name.

Xavier.

Tags: After Effects

Similar Questions

  • Setting the value of XML in Java script tag

    Hello

    I'm trying to set a value of XML tag in the initialize to a text field event... The code works correctly in FormCalc but I needed it to work in java script.

    FormCalc:

    $record.prospectApplication.typeName = "namedInsured";

    Java Script:

    xfa.record.prospectApplication.typeName = "namedInsured";

    The JavaScript above does not work. Can help any one on this?

    Thank you

    Srini

    Hi Srini,

    In JavaScript you do get all properties by default if you need to say;

    xfa.record.prospectApplication.typeName.value = "namedInsured";

    Who is assign the value to the property "value" not the dataValue object.

  • Set a value for the range selector

    Hello

    I'm trying to set a value for a range by script selector but without success.

    Here is my line of code:

    -app.project.item (1).layer("Text1").property ("ADBE Text properties") .property ("ADBE Text Animator").property("ADBE_Text_Selector").property ("ADBE Text Index End") .setValue (3);

    the error I get is "Undefiened is not an object.

    Maybe the property method does not work for the range selector.

    I am rookie in script... that could explain the issue

    Thank you

    Aurélien

    Looks like you're missing a few steps. A host of text is included in the Group of text animations. A range selector is in the Group of selectors of text. Each of them can be referenced by name or index (you can have several animators and selectors).

    App.Project.Item (1).layer("Text1").property ("ADBE Text properties") ("ADBE Text animators") .property .property (1).property("ADBE_Text_Selectors").property (1) .property ("ADBE Text Index End") .setValue (3);

    I recommend you google and download the script "GimmePropPaths" from Jeff Almasol. Invaluable for this kid to reference.

    Paul

  • Rounded values of AE setValueAtTime script?

    Hi guys,.

    I'm just getting started with extendScript, and I ran a question.

    I'm trying to set a keyframe to a value (admittedly) large, After Effects sets a value that is different from the value that I. It seems to be snapping more rounded and incoherently.

    For example, the values I put in the script, and what After Effects is layer on keyframe

    1248304.6823 1248304.625

    -4720535.9958 - 4720536

    4092748.7335 4092748.75

    You can see it seems to be 'registration' values in de.025 increments, but it does so inconsistently with a value to another. Is there a setting that I can put in the script to force it to use the actual value I want?

    What is strange is that if I copy and paste these values into After Effects directly on keyframes, it rounds up to 3 significant figures, as I expect.

    Is it all just because my numbers are too big? And if so, why the After Effects has no problem with the values?

    Ideas or ideas would be very appreciated!

    for (var i = 1; i & lt; = app.project.numItems; i ++) {}

    If (app.project.item (i) instanceof CompItem) {}

    model var = app.project.item (i);

    var textName = comp.layers.addText ('test');

    textName.threeDLayer = true;

    textName.position.setValueAtTime (0, [1248304.6823,-4720535.9958, 4092748.7335]);

    }

    }

    Zewt! You are a hero!

    I took an approach changed to your idea:

    I put int and decimal fractions of value as the positions on two null objects.

    Then I used an expression on the camera.position to combine these two values.

    Finally, I used this script I linked to convert expressions camera.position in keyframes and remove NULL values.

    That way I would create two distinct null objects and do not create two for each axis (x, y, z).

    In addition, the control slider has a limit of 1 000 000-1 000 000 which was not enough for what I had.

    For one in the future (or maybe me) who may fall on this solution.

    // Creating project
    var project = app.newProject();
    // Creating comp
    var comp = project.items.addComp('untitled', 1920, 1080, 1, 15, 30);
    // Open the comp
    comp.openInViewer();
    
    // Create a camera
    var cameraLayer = comp.layers.addCamera( 'Camera', [
      '${this.model.width / 2}',
      '${this.model.height / 2}'
    ] );
    
    var cameraPosition  = cameraLayer.position;
    
    var positionInts = comp.layers.addNull();
    positionInts.name = 'positionInts';
    positionInts.threeDLayer = true;
    
    var positionDecimals = comp.layers.addNull();
    positionDecimals.name = 'positionDecimals';
    positionDecimals.threeDLayer = true;
    
    // Set the int of all your values on the positionInts null
    positionInts.position.setValuesAtTimes(
        [0, 1, 2], [
            [4518810, -71312864, -2158705],
            [4522482, -71308958, -2158292],
            [4533658, -71297341, -2157044]
        ]
    );
    // Set the decimal of all values on the positionDecimals null
    positionDecimals.position.setValuesAtTimes(
        [0, 1, 2], [
            [0.6400621915236115, -0.80026875436306, -0.5924631282687187],
            [0.0393883166834712, -0.00048755109310150146, -0.32361961202695966],
            [0.004953828640282154, -0.6714665293693542, -0.026646549347788095]
        ]
    );
    
    // Create an expression on the camera position
    cameraPosition.expression = '[ thisComp.layer("positionInts").transform.position[0] + thisComp.layer("positionDecimals").transform.position[0] , thisComp.layer("positionInts").transform.position[1] + thisComp.layer("positionDecimals").transform.position[1], thisComp.layer("positionInts").transform.position[2] + thisComp.layer("positionDecimals").transform.position[2] ];';
    
    // Bake all the expression keyframes
    function convertToKeyframes(theProperty) {
        if (theProperty.canSetExpression && theProperty.expressionEnabled) {
            theProperty.selected = true;
            app.executeCommand(app.findMenuCommandId("Convert Expression to Keyframes"));
            theProperty.selected = false;
        }
    }
    
    convertToKeyframes( cameraPosition );
    

    Thanks again for your contribution!

  • Set the value of selectOneChoice managed Bean

    Hello Experts,

    My script is as follows: -.

    I have a selectOneChoice in my page and I fill it with values in the loading of the page (in the constructor of my managed bean) and he filled in correctly

    < af:selectOneChoice binding = "#{viewScope.MyBean.select}" >

    < f: selectItems value = "#{viewScope.MyBean.arr}" >

    < / af:selectOneChoice >

    ARR = new ArrayList < selectItem > ();

    arr. Add (new selectItem ("1", "Label 1"));
    arr. Add (new selectItem ("2", "Label 2"));
    arr. Add (new selectItem ("3", "Label 3"));
    arr. Add (new selectItem ("4", "Label 4"));


    Now, I need when I click a button on my page, make sure the value selected from the selectOneChoice '1 '.

    I tried the following, but it does not work:

    1 - select.setValue("1");

    2 - SelectItem TR = new SelectItem ("1", "Label 1");
    select.setValue (si);


    So, how can I do in my managed bean?


    I appreciate your help and thanks in advance

    The has a value property that the component stores the selected value. You can either declare a temporary variabel on the page (http://tompeez.wordpress.com/2013/03/25/creating-variables-and-attribute-bindings-to-store-values-temporarily-in-the-pagedef/) and use this variable to store the selected value, or you can use a bean for this property. Once you have set the value property, you can select the entry by setting the value property to the index that you want to select.

    Timo

  • I'm trying to set the value for a textfield to an another textfield instance in a repeating subform

    Hi all

    I try to set the value of a textfield in a repeating subform/table row to another textfield in a subform that is repeated with the corrosponding instance number.

    The user has entered a list of key activities in the first part: - KeyActivityRow is the repeating subform.

    xfa.resolveNode ("form1. #subform. KeyActivities.Row1.Table2.KeyActivityRow.Cell2')

    -KeyActivityRow is the repeating subform-

    Who fills the corresponding occurrence of: -.

    xfa.resolveNode ("form1. #subform. ActivityTable.HeaderRow.Table1.HeaderRow.Cell1')

    -ActivityTable is the repeating subform-

    Kevin

    In the event of form1 calculate. #subform. ActivityTable.HeaderRow.Table1.HeaderR OE. Cell1 enter this script in any language: JavaScript:

    this.rawValue = xfa.resolveNode ("form1. #subform. KeyActivities.Row1.Table2.KeyActivityRow ["+ ctivityTable.index +"]. Cell2") .rawValue

    Kyle

  • Set the value of items when the box is checked

    Hello

    My requirement is when a checkbox is clicked it should set the value of an element such as 111111 and clear the values of two objects in a page of the apex.
    I used the java script onClick event to set the items using document.getElementByID ('Item_Name') = ";
    One element that needs to be eliminated is a type of conditional.
    When the element condional, java script works very well. But if it is not present.
    code works, but it displays "error on page" for a few seconds.

    Is it possible to erase the element only when the element is present in the page.

    Thank you
    Ravi

    Hello

    Yes as for example

    if($x("ITEM_NAME")){
     $s("ITEM_NAME", "");
    }
    

    Kind regards
    Jari

  • Set the value to the field on another Page

    Hello

    I'm still a little new to this, through forums, that I managed to learn a lot of things. But I met another difficulty. I have

    I created a form in LiveCycle with two pages. On page 1, the fees are calculated by multiplying Field1 * Field2 and by adding the value of another. I managed to accomplish this with the following code:

    This.rawValue = Field3.rawValue + (Field1.rawValue * Field2.rawValue)

    As I said, that seems to work.

    To Page 2, I have a drop down list with five options. In the object > value tab I checked specify point values but has not changed a thing. If the value of the option range from 1 to 5.

    When option 5 is selected I want to set a value for a field that is Page 1. I tried with the following script:

    If (this.rawValue = 5) {}

    Page1.positionedSubform.field3.rawValue = 149;

    } else {}

    Page1.positionedSubform. Field3.rawValue = 0;

    }

    I'm now writer at all, but it seems to work somehow. Not that I want to :-).

    When I saw the PDF that it auto sets the value of Field3 and the drop to 149 field.

    I want to first Field3 on page 1 to 0 by default (entered in the object > field value tab 3) and set it to 149 if you have selected the option with the value of 5 in the drop down list on page 2.

    Any ideas?

    (Sorry for the bad explanation, don't know how to explain it better is if)

    Hello

    Did you use the calculate event in the drop-down list? If so, move the script to the output of the dropdown event.

    Niall

  • How to set a value in a numeric field based on a checkbox field?

    I try to get a numeric field to return to a certain numerical value according to the response from the user for a checkbox control. Here is my code:

    If (CheckBox1 .rawValue [0] == 1) then $.rawValue == 969.00 else $.rawValue == "" endif

    When the form is displayed, the value of the numeric field poster in the form $1,00 and if I check the box it changes $ 0.00 - but I want him back $969,00 if checked and be empty when not checked.

    Can someone help me understand this?

    Hello

    FormCalc syntax, so make sure that you have set the language in the script in FormCalc Editor.

    Also, you are right when you test equal to use the double equal sign ==. However, when you set a value, you use a single equal sign.

    FormCalc does not need the .rawValue.

    Make sure you have set the 'specify values' tab of object/link check box and on = 1. [0] in your script also indicates that there is more than one occurrence of CheckBox1. I'd be inclined to objects of unique name, as it makes it easier to script.

    So it should work in the case of calculating the numeric field:

    if (CheckBox1 == 1) then
         $ = 969.00
    else
         $ = 0.00
    endif
    

    Configures the model of the numeric field for monetary symbols, etc.

    Good luck

    Niall

    PS you can put figs in quotes. Also having the calculate event script will automatically make the calculated - read only field. You can, but if you do not you can change it in the tab/value of the object. On the other hand, you can have a script similar to the output of the box event.

  • How to set the value of something in a component of the main application?

    Hello

    Maybe I've worked on it too long, but I can't understand how to set the value of the text property of a text entry field in my main application component in a block of mx:Script. I have a component called Login in the components folder, and I need to set the text value of empNum. In my statement of mxml up there, I said these components such as xmlns = "components.*" so, logically, the property, I'm putting a c.Login.empNum.text. I can't understand the correct syntax to make this work, and I've tried everything I can think of. Does anyone have any suggestions? I think this should be easy, and there is just something missing me.

    Thank you!
    Holli

    Have you tried to give him an id?

    If later you can make the loginScreen. empNum.text = "my text".

    Laurent,

  • Setting a value of text inside a component within a component

    Overview:
    Building an application with a viewstack that contains several paintings. The canvases each contain components.

    Problem:
    You will need to set a value of text inside a child component when the user clicks on an item in the datagrid control. The DataGrid itself is in a component of the Web. I have problems affecting in the Script block. Here's the relevant code.

    Essentially, what I try to do is update an another datagrid when an item is selected in the parent DataGrid.

    Thanks for any help.

    Be aware of the problems of instantiation with viewStack and other containers of navigation.

    Components of the children of a view are not renered until they are navigated by the user, so you cannot set properties on Viewstack children until they are read.

    Maybe that's your problem?

  • Setting a value of option button using Javascript

    After much research, I realized that the appropriate command to get the value of a radio button in JavaScript of the APEX is 'html_RadioValue', but I was not able to understand a command that will allow you to that you set the value of the option button. Is there a documentation on the use of the APEX of the JavaScript which covers this issue?

    Here is a simplified version of the script:


    < script language = "JavaScript" type = "text/javascript" >
    function showval()
    {
    var item1 = html_RadioValue ('P19_RADIO');
    Alert (Item1);

    Invert the current selection
    If (item1 == 'Y') then
    {
    < mystery_statement > //set P19_RADIO n.
    }
    on the other
    {
    < mystery_statement > P19_RADIO //set to Y.
    }
    }
    < /script >


    I tried the following, but none of them have worked:

    -document.getElementById ("P19_RADIO") .value = 'n';
    -document.getElementById ("P19_RADIO") .checked = 'n';
    -$x('P19_RADIO').value = 'n';
    -$x('P19_RADIO').checked = 'n';


    Thank you.

    Chris:

    - document.getElementById("P19_RADIO_0").checked = true; // should work. '0' is the index of the first item in the radio group
    

    3.1.2 APEX Javascript APIs are documented here

    http://download.Oracle.com/docs/CD/E10513_01/doc/apirefs.310/e12855/javascript_api.htm#CDEEIGFH

    CITY

  • How to set the value of a variable in automator?

    I'm totally new to automator I found a post that I try to reuse

    to Re: copy multiple files from TextEdit in one Word file

    I want to open a series of html files in a folder and convert in a TextEdit rtf file.

    However, I am unable to automator find out how set the value of a variable such that it appears in this post

    I looked at every command in library without a lot of fortune

    Any help?

    Thank you

    Dan

    Its in Utilities.

    In Automator, use the search box:

  • Set the value of the parameter in the call sequence by programming

    Is there a way to set the value of the parameters of a call sequence with a vi with the context of the sequence in the order which is called? Cases not the same subseqence with a vi in the mainsequence maybe?

    In your VI, I think you should be able to set the value of Step.TS.SData.ActualArgs.paranumber.Expr to the value of the setting that you want. (This property is visible in the Variables pane, only if you have configured the Options of Station to display hidden properties). Note that the purpose of the step should refer to the sequence of your call step.  Also, remember that the property represents an expression, so if you want to pass the value 33, you must enclose the value in quotes ("33").

    Jeff

  • Set a value in each separate digital output in qnx

    Hello, I have two examples of the Eseries for outputs digital

    and they seem to work but when I change the value I want to put in the output of dig 1 it does not change.

    More accurately, I changed the digex1 of the example in this way:

    Write 0x00 to 0xFF for digital lines, can be checked by putting a breakpoint.
    for (i = 0; i<>
    theSTC-> DIO_Output.writeDIO_Parallel_Data_Out (0);

    but I still have 5V in the output.

    So, I want to be able to set a different value in each output of dig.

    How can I do so?

    Thank you

    Hello again once, I managed to change the values that I put on the output pin.

    Now I use the function

    DIO_Output.writeDIO_Parallel_Data_Out (0xFF);

    but I do not know how to set a value in a hairpin bend in particular and not in all of them.

    If someone knows something, it will be very useful.

    Thank you

Maybe you are looking for