Object disposal: how to make objects vanish when they enter the black hole

I can use a force object to simulate a black hole. It sucks in nearby cubes. They orbit it, back and forth, in tighter and tighter elliptical orbits.

That’s great, but I want each cube to disappear when it gets within x distance of the black hole, never to reappear.

Simply using a driver, that ties the cube’s scale to the distance, isn’t working because the cube scales back up and then back down as the distance changes. I need to know how to make the objects disappear from the scene.

I tried to write a scripted expression like “if (dist < 1) : set visibility of object to 0” but I am having a hard time learning how.

I only tried ‘scale’ because I thought it’d be easiest to write scripts for, but the scale keeps changing, in other words.