See @Vain_p Reply!
He posted a similiar thread that contains a good answer, check if it isn’t exactly what you need.