You need to package up a bunch of files, send them somewhere, and do something with them at the destination. It isn’t an uncommon scenario. The obvious answer is to create an archive — a zip or tar ...
It hurts to see your programs taken apart and their weaknesses exposed, but it will make you a better programmer.
Again, you make it all too complicated. Why do you want osascript to run a new shell with 'do shell script' when you are already in a shell script? You can simply let the current shell expand ...
A handful of useful productivity tools wrapped up in a simple shell script.