Re: XML generation details (was Re: ASObjC alloc and object creation)
Re: XML generation details (was Re: ASObjC alloc and object creation)
- Subject: Re: XML generation details (was Re: ASObjC alloc and object creation)
- From: Shane Stanley <email@hidden>
- Date: Tue, 30 Jan 2018 13:57:27 +1100
On 30 Jan 2018, at 12:25 pm, Jean-Christophe Helary
<email@hidden> wrote:
>
> Theoretical question: 1 + 5 = 2 + 4 so how does the system know I want
> options 1 and 5 instead of options 2 and 4 ? Or maybe I'm not talking about
> the same thing ?
Mostly there won't be an option equal to 5. If each option sets one bit, the
options will be 0, 1, 2, 4, 8, 16... If there is a value equal to 5, it will be
shorthand for 4 + 1, which means it shouldn't be used with 1.
>
> Question: is there a *really* good book on Cocoa that would help
> understanding all that with ASObjC in mind?
Not that I know of. Last I looked, the book market was very iOS focussed.
> theData's writeToFile:"/users/suzume/Desktop/omegat.project" atomically:true
> encoding:(current application's NSUTF8StringEncoding) |error|:(missing value)
>
>>> where SD seemingly complains about |error|...
>>
>> AppleScript's equivalent of NULL is missing value.
>
> I got the error wrong, the encoding part is the first that fails to run:
>
> -[__NSCFData writeToFile:atomically:encoding:error:]: unrecognized selector
> sent to instance 0x7fed987c0800
We've both missed an important point: you're not writing a string, you're
writing raw data. That error is telling us that your data doesn't understand
that method, and that's because it's for writing strings to file, not data. You
want:
theData's writeToFile:thePath options:(current application's
NSDataWritingAtomic) |error|:(missing value)
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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