Welcome to the Scripting & API forum. Scripting & APIs are great! So why not have an entire forum dedicated to them? This is the place to share with others how to achieve advanced customizations and interactions.
When asking a “How-To” type question, be sure to include details on your specific use case. That’ll help the community better tailor their responses and work towards avoiding unnecessary back and forth!