> For the complete documentation index, see [llms.txt](https://alex-kessling.gitbook.io/alex-kessling-motion-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alex-kessling.gitbook.io/alex-kessling-motion-wiki/after-effects/ae-expressions/dumping-ground.md).

# Dumping Ground

### -Linear Wiggle \[on/off slider]

<div align="center"><figure><img src="https://alexkessling.com/wp-content/uploads/2023/04/AK_Post_3_8.gif" alt=""><figcaption></figcaption></figure></div>

```javascript
s = effect("Slider Control")("Slider");
a = wiggle(5,50);
b = value;linear(s,0,100,a,b);
```

{% hint style="info" %}
Description needed
{% endhint %}

#### -Split Layer name

```javascript
id = thisLayer.name.split(" - ")[1];
```

{% hint style="info" %}
Description needed
{% endhint %}

#### -Split Name for Data Entery

```javascript
id = thisLayer.name.split(" - ")[1];
id2 = thisLayer.name.split(" - ")[2];
footage("table.csv").dataValue([id,id2]);
```

{% hint style="info" %}
Description needed
{% endhint %}

#### -Random Color

```javascript
seedRandom(index,true);
random([0,0,0,1],[1,1,1,1])
```

{% hint style="info" %}
Description needed
{% endhint %}

#### -Ignore Parented Scale

```javascript
s = []; 
parentScale = parent.transform.scale.value; 
for (i = 0; i < parentScale.length; i++){ 
s[i] = (parentScale[i]== 0) ? 0 : value[i]*100/parentScale[i]; 
} 
s

```

{% hint style="info" %}
Add to the scale of the child you wish to keep the scale control of
{% endhint %}

#### -Link Colors

```javascript
id = thisLayer.name.split(" - ")[1];
comp("Style Sheet").layer("Color Style").effect(id)("ADBE Color Control-0001");
```

{% hint style="info" %}
Description needed
{% endhint %}

#### -Link Text Style

```javascript

var control = Math.floor(effect("Text Style")("Menu"));
switch (control)
{
case 1:
a = comp("Style Sheet").layer("Header").text.sourceText;
a.getStyleAt(0,0);
break;
case 2:
b = comp("Style Sheet").layer("Body").text.sourceText;
b.getStyleAt(0,0);
break;
case 3:
c = comp("Style Sheet").layer("Details").text.sourceText;
c.getStyleAt(0,0);
break;
default:
value;
break;
}
```

{% hint style="info" %}
Description needed
{% endhint %}

-Box Fits Text

```javascript
s = parent;
w=s.sourceRectAtTime().width+30
;
h=s.sourceRectAtTime().height+30
;
[w,h]
```

{% hint style="info" %}
add code to Size, Parent the text you want the box to fit to.\
number refer to padding&#x20;
{% endhint %}

#### -Number Counter + Prefix & Suffix

```javascript
/num = "prefix"+effect("Slider Control")("Slider").value.toFixed(0)+"suffix"; 
function addCommas(x) { 
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); 
} 
addCommas(num);

```

{% hint style="info" %}
Add a slider to the effect panel for value/animation control. \
Change "prefix" or leave blank "" for Prefix control same for "suffix"
{% endhint %}

#### -PointOnPath

```javascript
var path = thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
var trimPath = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").end /100;
var targetLayer = thisComp.layer("Shape Layer 1");
var point = path.pointOnPath(trimPath);targetLayer.toComp(point)+value;
```

{% hint style="info" %}
Follows end of Trim paths
{% endhint %}

#### -Track Trim&#x20;

```javascript
//Code 
var path = thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
var trimPath = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").end /100;
var realOffset = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").offset

realOffset = realOffset/360

var targetLayer = thisComp.layer("Shape Layer 1");
var point = path.pointOnPath((trimPath /2) + realOffset);

x = targetLayer.toComp(point);
```

{% hint style="info" %}
Position, on trimPath between Offset and end&#x20;
{% endhint %}

#### -TITLE

```
//Code 

```

{% hint style="info" %}
Description needed
{% endhint %}

#### -TITLE

```
//Code 

```

{% hint style="info" %}
Description needed
{% endhint %}

#### -TITLE

```
//Code 

```

{% hint style="info" %}
Description needed
{% endhint %}

#### -TITLE

```
//Code 

```

{% hint style="info" %}
Description needed
{% endhint %}
