In another thread, Shane Stanley posted a brilliant AppleScript that creates a PDF from any file that TextEdit can open, and I will use it as a function in an AppleScript application I am working on.
But I have one question: the script requires AppleScript 2.4 (in effect, that means OS X 10.10). Is there any way to build a script that (1) includes this function that requires AppleScript 2.4 and (2) will run under older versions and display a message saying that this function requires a more recent version? In other words, is it possible to write an AppleScript in which a function will run under recent versions but do something else under older versions?
I doubt this is possible, but AppleScript is always surprising me with what it can do, so I thought it would not hurt to ask.
P.S. After posting this, it occurred to me that it might be possible to do this by creating an AppleScript that requires AppleScript 2.4, and enclosing it inside an application bundle - and then, if the required OS version is found, run that script from the main script. Does this idea make sense? (Meanwhile, I’ll try it.)