I am looking for some opinions, so if you want to opine at length feel free. I am wondering what is the best way to build some script files. For example, I have an application that I’m building, it has about 21 functions. The MAIN function that really does the process (which involves exporting things from InDesign) runs about 240 lines. I now find myself needing to do some major refactoring to maybe break out some functions, that I once assumed would be contained in the main function, to be able to be separate and called by another function.
Soooo, my question is, how do you guys set up a large script/app? Do you try to break things down into very small functions with lots of return values or globals? Do you often have a large function that does the majority of the script’s work? As I’m learning Objective-C/Cocoa I see many very short functions, and this is coloring my Applescript now to lean towards smaller functions in general. But often I find that I need to employ tons of globals because 1 return value just doesn’t cut it.