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:
@@ -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, {});
|
||||
|
||||
Reference in New Issue
Block a user