• 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
system events XML suite -- it seems to be caching and holding XML objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

system events XML suite -- it seems to be caching and holding XML objects


  • Subject: system events XML suite -- it seems to be caching and holding XML objects
  • From: "Steven D. Majewski" <email@hidden>
  • Date: Thu, 13 Oct 2005 16:22:03 -0400


I'm grabbing some xml data from 'do shell script "ssh ... ' .

I stuck in a display dialog and verified that I'm really getting
different and uniq data every time I run, because, oddly,
although this seems to work:


tell application "System Events"

    make new XML data with properties {name:"PIDS", text:pidtxt}

    first XML element of result

set pidlis to value of every XML element of result whose name is "pid"

end tell


What really happens is that whatever results it gets the first time is what it returns on every subsequent run.


The script I'm calling has a variable for the number of PIDs ( persistent id's )
I request, so I changed one line above to:


make new XML data with properties {name:"PIDS"&numpids, text:pidtxt}


and the list returned changes with the numpids, but once that number has been used, it always returns the same initial data.

So it appears that once System Events creates a named XML data object,
it holds on to it. ( I haven't tried this over a reboot, so maybe not
forever! ) Trying to create a new XML data object with the same name
always returns the first one created with that name.

This stuff isn't well documented -- I got what seemed to be a working
example with the 'with properties'  previously on this list -- so I
didn't know if it required a name.

I took out the name property entirely and left only:

    make new XML data with properties {text:pidtxt}

and that seems to work.

But can anyone please explain what's going on ?


( I also tried several variations with explicitly named variables instead of using default "result" , as well as trying to use "my variable" to make sure the tell block wasn't making it System Event's variable, but none of those seemed to make any difference. )


-- Steve Majewski





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: system events XML suite -- it seems to be caching and holding XML objects
      • From: Emmanuel <email@hidden>
  • Prev by Date: Screen saver scripting
  • Next by Date: Re: date of question
  • Previous by thread: Re: Screen saver scripting
  • Next by thread: Re: system events XML suite -- it seems to be caching and holding XML objects
  • Index(es):
    • Date
    • Thread