Hi again,
i don't know how to reference a new short cut. As ai said i might be somehow possible with an AppleScript but i don't know how that works, and it won't work on Windows anyway.
Here is another "solution", it works and is actually quite useful:
- Open After Effects.
- Open the script editor (File>Scripts>Open Script File)
- Copy paste the code below
- Save it in your Scripts folder (not the ScriptUI Panels folder, there is no UI) under a name for which you are sure it will be the first in your scripts collections (for the test, i used $01_SelectCurrentKeys.jsx)
- Close After Effects.
- Then Open your After Effects Shortcuts.txt (see this thread for details on where to find it, how to edit it: )
- Choose a shortCut for "ExecuteScriptMenuItem01" (that's the hard part all combinations are taken already)
- Save and relaunch AE:
What the shorcut will do: select the keyframe right under the CTI for all selected layers. Any other key is deselected.
It's not exactly what you asked but... i think it's better: Use J/K to navigate and that new shortcut to actually select.
If you want to stick to your original idea, it gives you a base to start with.
Xavier.
$.global.script_doSelectCurrentKeys || (script_doSelectCurrentKeys = function script_doSelectCurrentKeys(){ var comp = app.project.activeItem, props, n, p, idx, DT; if (comp instanceof CompItem){ DT = Math.min(0.01, comp.frameDuration/10.0); props = comp.selectedProperties; for (n=0; n<props.length; n++){ p = props[n]; if (!p.numKeys) continue; idx = p.nearestKeyIndex(comp.time); if (Math.abs(p.keyTime(idx)-comp.time)<DT){ if (p.selectedKeys.length>0) p.selected = false; p.setSelectedAtKey(idx, true); } else if (p.selectedKeys.length>5){ p.selected = false; p.setSelectedAtKey(1, true); p.setSelectedAtKey(1, false); } else{ while (p.selectedKeys.length) p.setSelectedAtKey(p.selectedKeys[0], false); }; }; }; return; }); script_doSelectCurrentKeys();