• 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: Shane Stanley <email@hidden>
  • Date: Tue, 30 Jan 2018 00:04:07 +1100

On 29 Jan 2018, at 11:50 pm, Jean-Christophe Helary
<email@hidden> wrote:
>
> Practically speaking here is what I have:
>
> set project to current application's NSXMLNode's elementWithName:"project"
>
> set project_tags to {"tag1", "tag2"}
> repeat with child in project_tags
>       set child to (current application's NSXMLNode's elementWithName:child
> stringValue:"default")
>       (project's addChild:child)
> end repeat
>
> How do I later access the "tag1" element to further add children to it?


OK, now I understand what you're asking. Assuming there's only one element
named 'tag1":

set tag1Element to (project's elementsForName:"tag1")'s firstObject()

--
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

  • Follow-Ups:
    • 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>
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>)

  • 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