Re: Passing Variables Between Scripts
Re: Passing Variables Between Scripts
- Subject: Re: Passing Variables Between Scripts
- From: Shane Stanley <email@hidden>
- Date: Mon, 13 Dec 2010 08:52:12 +1100
- Thread-topic: Passing Variables Between Scripts
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