-
Show/Hide properties with keyframes from an extension
I’m trying to write an extension that can show/hide properties with keyframes.
The most relevant piece of code goes like this:var cmdStr = ‘Reveal Properties with Keyframes’;
executeCommand(cmdStr);
function executeCommand(cmdStr) {
var cmdId = 0;
cmdId = app.findMenuCommandId(cmdStr);
if (cmdId == 0) return cmdId;
app.executeCommand(cmdId);
return cmdId;
}
When called the first time, it works and opens keyframed props, but when called again, it opens all props of the layer.
I got an advice on Adobe Forum to change executeCommand function like this:
function executeCommand(cmdStr) {
var cmdId = 0;
cmdId = app.findMenuCommandId(cmdStr);
if (cmdId == 0) return cmdId;
// RevealAllModifiedProperties
app.executeCommand(2771);
app.executeCommand(2771);
app.executeCommand(cmdId);
return cmdId;
}
this doesn’t fix the problem because double 2771 call hides all props and original call opens them again, so this code can only show props but not hide them.Anyway, I tested both versions, below if the full code of the extension and how it works.
Does anyone know how to make a switch to show/hide keyed props?