@ Julie
Well, I don’t think I have any function you can just call, although, you might be able to use this code here and tweak it to suit your needs.
I hope that helps!