I’m curious about the pros and cons of different ways of setting up helper functions so that users can write their scripts without thinking too much about making them run on both Windows and Mac. (I’m thinking of helper functions that take care of the if-then logic of things like Command vs Control key, etc.)
One way I thought of doing this is to have a helper suite that has a separate script for each such helper function. Inside each script, there would be if-then logic that is based on a global OS variable set at the beginning of the script run. In this way, the if-then logic is abstracted away from the user trying to write a test script.
Another way I noticed in the Finale2006 demo on the Redstone downloads site involved the OS determination script doing a “start using” command and then all the helper functions are duplicated in two different scripts “HandlersOSX” and “HandlersWin”. This avoids the if-then logic being in each function, but also keeps it away from the user writing a test script.
There are probably multiple other ways of accomplishing this task that I have not thought of. Is there a recommended way to do this? Am I missing something?