On Jan 14, 2013, at 3:56 PM, Shane Stanley wrote: On 15/01/2013, at 8:13 AM, Luther Fuller < email@hidden> wrote: The handler someMenuItemHandler() calls other handlers which contain the line …
set selfRef to (path to me)
but this returns the correct path only if 'me' refers to the hostAppl. But in the script, above, the host code has been moved into menuItem.app and now returns the wrong path. Unfortunately, someMenuItemHandler must also work when called by Main.app, so I can't modify the code in Main.app.
Can you not pass the path as an argument to someMenuItemHandler()?
Of course I could. And I considered doing that ... until I realized that I would have to make the same changes to the script of Main.app which also uses someMenuItemHandler. This would make Main.app horribly complicated.
For example, in Main.app, I have a handler named "titleAndVersion()" which returns information for dialogs. Usually this information is not needed, but whenever it is needed any other handler can simply call it. If I pass this information as an argument, then I must first run a bunch of handlers, needed or not, before calling someMenuItemHandler which makes the code for calling someMenuItemHandler from Main.app unnecessarily complicated.
I have also considered some other solutions, but so far they all make simple code into something unnecessarily complicated.
The only real solution is for a really quick fix from Apple.
|