• 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: Nathan Greenstein <email@hidden>
  • Date: Sun, 12 Dec 2010 14:09:25 -0800

Thanks, Shane!
I coerced it to a string, and it worked, making me fell quite silly.

> readPrefs: implies a handler called readPrefs_(something), not readPrefs()
OK, makes sense. How can I stop it from thinking something is passed to it?

Thanks,
--
Nathan Greenstein
email@hidden



On Sun, Dec 12, 2010 at 13:52, Shane Stanley <email@hidden> wrote:
On 13/12/10 7:37 AM, "Nathan Greenstein" <email@hidden> wrote:

> This seems to work, but I get the following console error: Could not connect
> the action readPrefs: to target of class prefScript.

readPrefs: implies a handler called readPrefs_(something), not readPrefs().

> 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) .

That's right: whenever you call a handler in another script object, it's the
same as calling any Cocoa method, and you need to coerce the result to its
equivalent AppleScript class before you can use it with AppleScript classes.
Try:

display dialog (prefScript's varName) as text

--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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

 _______________________________________________
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: Shane Stanley <email@hidden>
References: 
 >Passing Variables Between Scripts (From: Nathan Greenstein <email@hidden>)
 >Re: Passing Variables Between Scripts (From: Shane Stanley <email@hidden>)

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