I've recently been using ChatGPT's "Code Copilot" to produce Swift scripts, and it's worked rather well. I started off by just asking for a simple function, largely as a means to get a working example ...