Auto Fit Text to Comp Width

Scales a text layer so it always fits the comp width minus margins.

Code

// Text > Scale
var margin = 100;
var w = thisLayer.sourceRectAtTime().width;
var compW = thisComp.width - margin * 2;
var r = compW / w * 100;
[r, r];
textscaleresponsive

How to Use

Adjust `margin` to leave more or less padding near the comp edges.