Merge pull request #843 from Ni-zav/fix/812-stable-script-undo-id-s20261011T141200Z-fd2e

fix(script): keep Undo command ID 16 stable for scripts

# Conflicts:
#	crates/script/src/tests.rs
This commit is contained in:
Brandon Thomas
2026-10-12 03:23:14 -04:00
2 changed files with 23 additions and 1 deletions
+6 -1
View File
@@ -1854,8 +1854,13 @@ var app = {
beginSuppressDialogs: function () {},
endSuppressDialogs: function () {},
purge: function () { __call("edit.purge", { what: "all" }); },
findMenuCommandId: function (name) { return __get("menuCommandId", { name: String(name) }); },
findMenuCommandId: function (name) {
// Well-known After Effects ids must not shift when EffectCraft registers a command.
if (String(name) === "Undo") return 16;
return __get("menuCommandId", { name: String(name) });
},
executeCommand: function (id) {
if (id === 16) return __call("edit.undo", {});
var cmd = typeof id === "number" ? __get("commandAt", { index: id }) : String(id);
if (!cmd) throw __err("Unknown command id " + id);
return __call(cmd, {});