Calling or running an AppleScript from within a Numbers workbook
I am considering a significant platform change from Windows/Android to straight Apple; I've been poking around to see if I can find the necessary apps for Mac use for my business, and by and large the answer seems to be that this is feasible. The bottom line is that I am fed up with serious problems with Windows running Microsoft Office (major problems with both Outlook and Excel - I'm simply tired of it.)
The most significant stumbling block I currently see is that I use Excel extensively (when it is not crashing) in my daily work habits. I have complex (by some standards) workbooks that utilize several macros each.
For example, when opening a numbered file (say 27442.xlsm), a macro called WorkBookName() pulls the name of the file, removes the extension, and places just the number in a specified cell.
While I see, conceptually at least, how to pull the file number using AppleScript, what I don't see is how to associate that script with any given workbook, so that it automatically calls it when the workbook is created or opened. It seems to me that the script has to be run independently, which is largely self-defeating of the automation I am trying to accomplish.
Can anyone with some expertise give me a little insight on this? I've poked around a number of forums and websites, but don't see quite the answers I am looking for right now.
Thanks
OS X Mavericks (10.9.2)