From 6f87a76b74f81754c7f0e976b5ac206643b6af3d Mon Sep 17 00:00:00 2001 From: IVG-Design Date: Mon, 10 Aug 2026 21:22:47 -0400 Subject: [PATCH 1/2] docs: explain Source Text repeat shorthand Document that repeat() is a standard JavaScript String method resolved against Source Text's current-property context, not a global After Effects API. Include explicit forms and the numeric-property limitation.\n\nValidated with mkdocs build --strict. --- docs/text/sourcetext.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/text/sourcetext.md b/docs/text/sourcetext.md index b74ebb6..177216b 100644 --- a/docs/text/sourcetext.md +++ b/docs/text/sourcetext.md @@ -6,6 +6,23 @@ These functions are accessible on the [Text.sourceText](text.md#textsourcetext) --- +## JavaScript String methods + +When the JavaScript expression engine is active, After Effects interprets a Source Text value as a JavaScript String. Because the current property is the default object for an expression, supported String instance methods can be called without an explicit receiver. + +For example, if the Source Text value is `"AE"`, each of these expressions returns `"AEAEAE"`: + +```js +repeat(3); +value.repeat(3); +text.sourceText.repeat(3); +``` + +!!! note + `repeat()` is the standard JavaScript [`String.prototype.repeat()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) method, not a global After Effects method. The receiver-less form is specific to a Source Text expression and is undefined on numeric properties. To repeat a different string, call the method on that string explicitly, such as `"AE".repeat(3)`. + +--- + ## Attributes ### SourceText.isHorizontalText From 39e88c402f6e114032055fd672a1d597d53839d6 Mon Sep 17 00:00:00 2001 From: IVG-Design Date: Mon, 10 Aug 2026 21:46:57 -0400 Subject: [PATCH 2/2] docs: scope repeat shorthand to verified behavior Narrow the section from a general String-method rule to the specific receiver-less repeat behavior verified in AE 26.3 and 27.0 Beta. Note that Adobe does not explicitly document receiver-less dispatch for standard JavaScript prototype methods. Validated with mkdocs build --strict. --- docs/text/sourcetext.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/text/sourcetext.md b/docs/text/sourcetext.md index 177216b..1d4b605 100644 --- a/docs/text/sourcetext.md +++ b/docs/text/sourcetext.md @@ -6,9 +6,9 @@ These functions are accessible on the [Text.sourceText](text.md#textsourcetext) --- -## JavaScript String methods +## `repeat()` shorthand -When the JavaScript expression engine is active, After Effects interprets a Source Text value as a JavaScript String. Because the current property is the default object for an expression, supported String instance methods can be called without an explicit receiver. +When the JavaScript expression engine is active, After Effects interprets a Source Text value as a JavaScript String. In a Source Text expression, `repeat()` can be called without an explicit receiver to repeat the current text value. For example, if the Source Text value is `"AE"`, each of these expressions returns `"AEAEAE"`: @@ -21,6 +21,9 @@ text.sourceText.repeat(3); !!! note `repeat()` is the standard JavaScript [`String.prototype.repeat()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) method, not a global After Effects method. The receiver-less form is specific to a Source Text expression and is undefined on numeric properties. To repeat a different string, call the method on that string explicitly, such as `"AE".repeat(3)`. +!!! warning + Adobe documents Source Text's JavaScript String behavior, but does not explicitly document receiver-less dispatch for standard JavaScript methods. This shorthand has been verified in After Effects 26.3 and 27.0 Beta; use the explicit `value.repeat(3)` form when clarity or portability is preferred. + --- ## Attributes