I’ve created a plugin from it: https://github.com/texnixe/kirby-structure-id
Let me know if it works for you.