• 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
Cannot pass script object as parameter to run script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cannot pass script object as parameter to run script


  • Subject: Cannot pass script object as parameter to run script
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 19 May 2010 13:39:51 +0100

It would seem that you cannot pass an ASObjC script object as a parameter to run script:

-- me is an NSObject subclass that responds to test()
set theScript to me

set expr to "on run {x} " & linefeed & "tell x to test()" & linefeed & "end" & linefeed
run script expr with parameters {theScript}

Presumably the problem arises because another component instance is created
and that instance baulks at the ASObjC-object as follow:

«class ocid» id «data kptr50FE2101» doesn’t understand the test message

Creating a copy of the theScript and passing that dispels the error but the test() handler is not called.
Coercing to as script has no effect.

It would also appear that regular script definitions, ie: those that are not subclasses of NSObject
also cannot be successfully utilised as run script parameters.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com







 _______________________________________________
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

  • Prev by Date: run script fails to execute handler
  • Next by Date: Adding a third party framework (core plot)
  • Previous by thread: run script fails to execute handler
  • Next by thread: Adding a third party framework (core plot)
  • Index(es):
    • Date
    • Thread