Set active fcurve in Graph Editor?

Hi!

I’m having trouble figuring out how to set an fcurve to “active” through script.

Here you see there are no selected curves:

Setting one of the curves to “selected” will give you this:

But what I’m trying to get is this:

The channel will become active if you click the channel in the channel list, or click-select on one of the keys on the curve, but I need to set the curve active through script. I’ve been digging through the API reference but can’t find anywhere to set this property.

I found this post:
https://blenderartists.org/t/selecting-animation-channel/677283

But I couldn’t really make sense of it. It appears to deal with sorting the curves in to groups, but it seems like setting a channel to active would be more straight-forward than all that.

Does anyone know how to set the active channel/curve in the Graph Editor? I’m stuck!

Thanks!

Just bumping this since I’m still stuck on it.

I also posted up on blender.stackexchange:
https://blender.stackexchange.com/questions/127636/set-active-fcurve-in-graph-editor-through-python

Maybe @batFINGER or @aligorith can help?

I posted this almost 20 days ago and have yet to get a single reply so can anyone recommend a better place to ask the question? I’ve tried here and stackexchange with no luck.
I’ve continued trying to make sense of the source code but always wind up at dead ends. I’m kind of stuck on my script until I can figure this out and have tried every hack and workaround I can think of. Anyone? Please?