Hi All,
I've got a main script (class myappAppDelegate), and another one for some other functions (class prefScript).
In the main AppDelegate script, I've got a prefScript property (defined as missing value).
In IB, I have an object whose class is prefScript, and has an outlet to the AppDelegate script (connected to the aforementioned prefScript property).
In the AppDelegate's awakeFromNib handler, I say the following: prefScript's readPrefs() . This seems to work, but I get the following console error: Could not connect the action readPrefs: to target of class prefScript . However, it still calls the function successfully. The problem comes when I want to use a variable that was defined in that readPrefs() handler. I have the global varName line before the variable is defined. But, when I try to use that variable (defined in the extra script) in the main script, nothing happens. Here's the code:
tell current application to display dialog (prefScript's varName)
That produces a console error from the main script, -[myappAppDelegate awakeFromNib]: Can’t make varName of «class ocid» id «data kptr00000000C02D4A0002000000» into type string. (error -1700) . I know that the problem isn't in the variable, because display dialog varName works fine if it's part of the readPrefs() handler itself.
I've tried messing with parentheses, changing the extra script's parent to the main one (this causes a crash), and changing the handler name to readPrefs_(sender), but nothing has helped.
I must be missing something here.
Thanks in advance!