Created
November 16, 2025 06:40
-
-
Save monsieuroeuf/808569ba3d9a0538b4db0b44d1fd9e92 to your computer and use it in GitHub Desktop.
For Adobe After Effects, Mac only. Rename selected layers based on the clipboard contents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //@target aftereffects | |
| /** | |
| * 2025-04-07 | |
| * @description This script renames selected layers in the active composition based on the clipboard content. | |
| */ | |
| (function renameFromClipboard() { | |
| var proj = app.project; | |
| app.beginUndoGroup("renameFromClipboard"); | |
| // const newNames = app.getenv("argumentative") | |
| var newNames = readFromClipboard().split("\n"); | |
| if (newNames.length !== proj.selection.length) { | |
| alert("The number of names in the clipboard does not match the number of selected layers."); | |
| return; | |
| } | |
| var selectedItemsSorted = proj.selection.sort(function (a, b) { | |
| return a.name < b.name ? -1 : 1; | |
| }); | |
| for (var i = 0; i < selectedItemsSorted.length; i++) { | |
| var item = selectedItemsSorted[i]; | |
| if (item instanceof CompItem) { | |
| item.name = newNames[i]; | |
| } | |
| } | |
| function readFromClipboard() { | |
| var cmd = 'pbpaste'; | |
| return system.callSystem(cmd); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment