• 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: Another Weird AppleScript-ObjC Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another Weird AppleScript-ObjC Problem


  • Subject: Re: Another Weird AppleScript-ObjC Problem
  • From: Dave <email@hidden>
  • Date: Tue, 17 Nov 2015 12:44:33 +0000
  • X_v_e_cd: 9f02acf3016f0e16e4520235bb5c84a3
  • X_v_r_cd: dcc6f3e6618f7f3b30928a2ba7195ff4

Hi Shane,

I Found the problem - see separate post.


On 17 Nov 2015, at 12:11, Shane Stanley <email@hidden> wrote:

On 17 Nov 2015, at 10:34 PM, Dave <email@hidden> wrote:

And myMessageDictionary is setup ok an is of type “record", but when it gets back to Objective-C land myMessageDictionary == nil. I’m wondering if its something to do with passing dictionaries between Objective-C and AS?

There are limitations. AppleScript records are a case of smoke-and-mirrors: if the keys are user variables, they get converted to strings when passed to Objective-C. But if the keys are application keywords, they are stored in records differently, and they disappear when passed to Objective-C.

So if you have a record like this:

set someRecord to {button returned:"OK", text returned:"blah", someThing:"42"}

you'll end up in Objective-C with:

 @{"someThing" : "42"}

So you can't just pass a record that is a record of some object's properties returned from an app, for example. And if a value is missing value, that item will disappear in Mavericks.


Yes, I’ve been bitten by this already, I only pass Strings, Arrays and Dictionaries back and forth across the Bridge……..

Just seen this!!! You should have plugged it before, I’ve just bought a copy! Is there a quick start guide available for what I’m trying to do?
Also what book(s) would you recommend for AppleScript-ObjC?

I think my books are the only ones with any detail, and it looks like you now have them (thanks!). They're really written more from someone coming from an AS background, and unfortunately you're hitting AS issues. Scan the first few chapters of the Reference section of 'AppleScript Explored', and probably the early chapters of the other one. Otherwise keep asking here.

Yes, got them. 


I’m just about to look at this with ScriptExplorer, I wondering if I can step through AS Code in the Debugger when the .applescript file in an XCode Project?

Unfortunately, no. The debugger works by injecting code, and has to host the script itself.

Oh well, can’t have everything and it’s MUCH better than ScriptEditor which crashes all over the place…..

Thanks a lot,  All the Best
Dave

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Another Weird AppleScript-ObjC Problem
      • From: Dave <email@hidden>
References: 
 >Another Weird AppleScript-ObjC Problem (From: Dave <email@hidden>)
 >Re: Another Weird AppleScript-ObjC Problem (From: Shane Stanley <email@hidden>)
 >Re: Another Weird AppleScript-ObjC Problem (From: Dave <email@hidden>)
 >Re: Another Weird AppleScript-ObjC Problem (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Found It!! Another Weird AppleScript-ObjC Problem
  • Next by Date: Re: Another Weird AppleScript-ObjC Problem
  • Previous by thread: Re: Another Weird AppleScript-ObjC Problem
  • Next by thread: Re: Another Weird AppleScript-ObjC Problem
  • Index(es):
    • Date
    • Thread