active state

Georg Hajdu's icon

Is there a JavaScript method capable of querying the active state of a parent patcher? Say, I have a bpatcher and want to know whether its patcher window is frontmost, but don't want to create an active object in the parent patcher.

Hans Höglund's icon

No offense, but this sounds like poor encapsulation to me. Why not let the bpatcher support an active message and let users issue it from the parent patcher?

Georg Hajdu's icon

I had the Max for Idiots kind of person in mind. That's why...

Actually, there was a time when there was no JavaScript at all, and my patches were all running just fine...

Georg

Luke Hall's icon

Try checking the current filepath against the frontmost filepath as shown below.

lh

max.frontpatcher.filepath == this.patcher.filepath