Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87055

Re: Re: Select Next Keyframe (in selected property) script

$
0
0

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:

 

  1. Open After Effects.
  2. Open the script editor (File>Scripts>Open Script File)
  3. Copy paste the code below
  4. 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)
  5. Close After Effects.
  6. Then Open your After Effects Shortcuts.txt (see this thread for details on where to find it, how to edit it: Re: Custom hotkeys)
  7. Choose a shortCut for "ExecuteScriptMenuItem01" (that's the hard part all combinations are taken already)
  8. 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();

Viewing all articles
Browse latest Browse all 87055

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>