Re: Another Weird AppleScript-ObjC Problem
Re: Another Weird AppleScript-ObjC Problem
- Subject: Re: Another Weird AppleScript-ObjC Problem
- From: Shane Stanley <email@hidden>
- Date: Tue, 17 Nov 2015 23:11:18 +1100
- X_v_e_cd: cea654e50dd86a95d3515e71b54ba108
- X_v_r_cd: 61c5bcb70a5f5a2e6c7bd2c151c6461e
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.
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. 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. |
_______________________________________________
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