Request for help with a script
I’m working on a Visual Music film that uses Audio Amplitude layer keyframes created through Audio Layer > Keyframe Assistant > Convert Audio to Keyframes. The result is one linear keyframe per frame (@ 24 fps). Because its desired to act as a switch to turn on/off I’ve converted all the keyframes to hold keyframes.
These key frames will be used to turn the opacity of a shape layer on and off to synchronize graphics to audio. The desired value of the keyframes should be restricted to 0 (off) or 100 (on). Keyframes of any value of other than 0 or 100 are to be deleted.
I worked up an algorithm by hand processing the keyframes. But since there are over 1000 keyframes to be processed I’d like to automate the process with a script. An elaborate interface is not necessary, the goal is get the keyframes processed to get on to making the film.
The workflow:
• Prompt user to select a range of keyframes.
• Create array of keyframe values from selection.
• Set first keyframe in selection to 0.0.
• Set second keyframe in selection to 100.0.
• Set last keyframe in selection to 0.0.
• In a loop find any elements in array that are > 0.0 and < 100.0 and delete them.
My problem is that the last actual programming experience I’ve had was 40 years ago in a community college course in c++. I’ve had no experience in Javascript which After Effects uses.
I’m using a M1 Pro MacBook Pro running Tahoe 26.5.1 with 32 GB memory.
Can anyone off some assistance/advice how to accomplish this? Thanks in advance.
Charles Bandla
Rochester, ny
