Hi all! I’ve been trying to come up with a way to utilize extensions in a script and make the script shareable without forcing anyone who downloads the script to download the same set of extensions that I happen to like and use. I’ve managed to write a conditional that works to check for the presence or absence of a given extension (i.e., it returns true
if the extension is present and false
if the extension is absent) and runs certain functions that utilize that extension only if the extension is present. But when I removed the extension from my extensions folder, I realized that the script still wouldn’t run!
Have others done anything like this? I did some searching and didn’t see any questions quite like this — maybe it’s not a super common use case. In my case, I’m trying to make a script that’ll utilize a monome grid if you’ve got one but will pop up a gui grid if you don’t. And I’ve got that working, but only if the monomeSC extension (for using monome grid with SuperCollider) is present. Here’s a gist of the WIP script, to give a sense of what I mean. The conditional extension stuff is happening in the first 100 lines. It doesn’t seem sensible to have people who don’t have grids downloading the monomeSC extension just to run this script. I’m stumped and would very much appreciate any guidance anyone has to offer!