• 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: XML generation details (was Re: ASObjC alloc and object creation)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML generation details (was Re: ASObjC alloc and object creation)


  • Subject: Re: XML generation details (was Re: ASObjC alloc and object creation)
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Mon, 29 Jan 2018 23:25:08 +0900

Ok, last one for this code page...

set theData to theProject's XMLDataWithOptions:((current application's
NSXMLDocumentTidyXML) + (get current application's NSXMLNodePrettyPrint))
theData's writeToFile:"/path/to/file" atomically:true

1) What I get from the Xcode documentation for XMLDataWithOptions is:

One or more options (bit-OR'd if multiple) to affect the output of the
document; see Constants <apple-reference-documentation://hc1_X8m4hw> for the
valid output options.

:-) I'm glad I know English...

So that "+" between the two options is the bit-OR thing? Also, when I click on
the "Constants" link I don't find NSXMLDocumentTidyXML nor NSXMLNodePrettyPrint
but they *are* in the doc, under NSXMLNodeOptions, which is confusing...

But in any case, what I get there is:

    NSXMLDocumentTidyXML = 1UL << 10,
    NSXMLNodePrettyPrint = 1UL << 17,

Which really doesn't mean much to me.

2) writeToFile:atomically: is an NSString instance method and seems to be
deprecated. But when I try writeToFile:atomically:encoding:error: instead, I
fumble:

theData's writeToFile:"/path/to/file" atomically:true encoding:(current
application's NSUTF8StringEncoding) |error|:NULL

where SD seemingly complains about |error|...

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune


 _______________________________________________
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: XML generation details (was Re: ASObjC alloc and object creation)
      • From: Shane Stanley <email@hidden>
References: 
 >ASObjC alloc and object creation (From: Jean-Christophe Helary <email@hidden>)
 >Re: ASObjC alloc and object creation (From: Shane Stanley <email@hidden>)
 >Re: ASObjC alloc and object creation (From: Jean-Christophe Helary <email@hidden>)
 >Re: ASObjC alloc and object creation (From: Jean-Christophe Helary <email@hidden>)
 >Re: ASObjC alloc and object creation (From: Shane Stanley <email@hidden>)
 >Re: ASObjC alloc and object creation (From: Jean-Christophe Helary <email@hidden>)
 >XML generation details (was Re: ASObjC alloc and object creation) (From: Jean-Christophe Helary <email@hidden>)
 >Re: XML generation details (was Re: ASObjC alloc and object creation) (From: Jean-Christophe Helary <email@hidden>)
 >Re: XML generation details (was Re: ASObjC alloc and object creation) (From: Jean-Christophe Helary <email@hidden>)
 >Re: XML generation details (was Re: ASObjC alloc and object creation) (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: XML generation details (was Re: ASObjC alloc and object creation)
  • Next by Date: Re: XML generation details (was Re: ASObjC alloc and object creation)
  • Previous by thread: Re: XML generation details (was Re: ASObjC alloc and object creation)
  • Next by thread: Re: XML generation details (was Re: ASObjC alloc and object creation)
  • Index(es):
    • Date
    • Thread