<p>I found out - <strong>.value</strong> after slider.effect("Slider Control").property("Slider") and it works.</p>

<pre><code>var a = slider.effect("Slider Control").property("Slider").value
</code></pre>

CC BY-SA 3.0
2016-04-25T07:58:44.903Z
2016-04-25T07:58:44.903Z
49volro
<p>I'm newbie in After Effects. I've learned how to control slider from expressions. Now I need to get value of slider in script (jsx/extendscript). How can I achieve that?</p>

<p>I've tried (in *.jsx): <code>var a = comp.layer("Slider 1").effect("Slider Control")("Slider")[0];</code></p>

<p>Result: </p>

<blockquote>
  <p>After Effects error: Unable to call "setValue" because of parameter 1.
  Value "NaN" of element 0 in the array is not a valid float.</p>
</blockquote>

<p>It means that value of slider is not set yet?</p>

<p>Thanks</p>

<p><strong>EDIT:</strong></p>

<p>Here is a example:</p>

<pre><code>var slider = comp.layers.addNull();
slider.name = "Slider";
slider.effect.addProperty("ADBE Slider Control")("Slider");
slider.effect("Slider Control").property("Slider").setValue(100);

var a = slider.effect("Slider Control").property("Slider");
var titleTriangle = comp.layers.addShape();
titleTriangle.name = ("Title Triangle");
var titleTriangleGroup = titleTriangle.property("Contents").addProperty("ADBE Vector Group");
var titleTriangleFill= titleTriangleGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
titleTriangleFill.property("Color").setValue([0.68,0.29,0.29,1]);

// using 'a' here
titleTriangle.property("Position").setValue([a,188]);
</code></pre>

CC BY-SA 3.0
2016-04-24T12:31:07.947Z
Please paste all code here. It is difficult to understand, where can be problem, when you are seeing only part of code.
Shultc
CC BY-SA 3.0
2016-04-24T14:38:30.583Z
@Shultc, thank you for response. I have added an example.
49volro
CC BY-SA 3.0
2016-04-26T04:57:20.323Z
Sounds like you need to know about Redefinery's **RD_Gimme_Props** script. It's a script that allows you to find the correct path for any composition element: http://bit.ly/1XTIzh0 There's a whole bunch of tools there for extendscript developers.
stib
<after-effects><after-effects-expressions>
After Effects: controlling slider in ExtendScript
49volro
# After Effects: controlling slider in ExtendScript

(Asked by: username_0 on 2016-04-24)

I'm newbie in After Effects. I've learned how to control slider from expressions. Now I need to get value of slider in script (jsx/extendscript). How can I achieve that?
I've tried (in *.jsx): var a = comp.layer("Slider 1").effect("Slider Control")("Slider")[0];
Result: 

After Effects error: Unable to call "setValue" because of parameter 1.
  Value "NaN" of element 0 in the array is not a valid float.

It means that value of slider is not set yet?
Thanks
EDIT:
Here is a example:
var slider = comp.layers.addNull();
slider.name = "Slider";
slider.effect.addProperty("ADBE Slider Control")("Slider");
slider.effect("Slider Control").property("Slider").setValue(100);

var a = slider.effect("Slider Control").property("Slider");
var titleTriangle = comp.layers.addShape();
titleTriangle.name = ("Title Triangle");
var titleTriangleGroup = titleTriangle.property("Contents").addProperty("ADBE Vector Group");
var titleTriangleFill= titleTriangleGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
titleTriangleFill.property("Color").setValue([0.68,0.29,0.29,1]);

// using 'a' here
titleTriangle.property("Position").setValue([a,188]);

**Tags:** after-effects, after-effects-expressions

> **Comments:**
> **username_1**: Please paste all code here. It is difficult to understand, where can be problem, when you are seeing only part of code.  
> **username_0**: @username_1, thank you for response. I have added an example.  
> **username_2**: Sounds like you need to know about Redefinery's **RD_Gimme_Props** script. It's a script that allows you to find the correct path for any composition element: http://bit.ly/1XTIzh0 There's a whole bunch of tools there for extendscript developers.  

---

## 1 answers

### Answer by username_0 on 2016-04-25. Score: 3 | Accepted answer

I found out - .value after slider.effect("Slider Control").property("Slider") and it works.
var a = slider.effect("Slider Control").property("Slider").value


---

