• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Passing Variables Between Scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing Variables Between Scripts


  • Subject: Re: Passing Variables Between Scripts
  • From: Alex Zavatone <email@hidden>
  • Date: Sun, 12 Dec 2010 14:46:14 -0600

I just set up accessors and called the accessor in the class.

On Dec 12, 2010, at 2:37 PM, Nathan Greenstein wrote:

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!

--
Nathan Greenstein
email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Passing Variables Between Scripts
      • From: Nathan Greenstein <email@hidden>
References: 
 >Passing Variables Between Scripts (From: Nathan Greenstein <email@hidden>)

  • Prev by Date: Passing Variables Between Scripts
  • Next by Date: Re: Passing Variables Between Scripts
  • Previous by thread: Passing Variables Between Scripts
  • Next by thread: Re: Passing Variables Between Scripts
  • Index(es):
    • Date
    • Thread