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
|