?

Log in

how can i save some string to xml file? - applescript [entries|archive|friends|userinfo]
applescript

[ website | Apple's AppleScript Home Page ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

how can i save some string to xml file? [Jan. 9th, 2009|09:10 pm]
applescript

applescript

[carlogulliani]
hi, everybody, does anybody can help me?
i need to save 4 lines to xml file, i wrote the next code:

set thepath to "" & (path to desktop)

set theFile to thepath & "control.xml"

set TheText to "<?xml version='1.0' encoding='UTF-8'?>

<remote>

<command value='aaa'/>

<remote>" & return

 

open for access file theFile with write permission

set eof file theFile to 0

write TheText to file theFile starting at eof as Unicode text

close access file theFile


but it doesn't correct work for me, i receiving file like SimpleText Document and i don't working with it like xml document (after all i wanna load it in my flash app)

linkReply

Comments:
[User Picture]From: xv
2009-01-09 06:30 pm (UTC)
There is some terminology in the System Events dictionary that deals with XML. There is also a Scripting Addition you can install for more commands. I'm assuming there is a reason you have to write part of this in AppleScript, but if you can it may be simpler to do your xml part with do shell script.
(Reply) (Thread)
[User Picture]From: carlogulliani
2009-01-09 06:47 pm (UTC)
ok, thanks for yr reply and for the link, yes, i thought about shell command, but i haven't how to do it with do shell?

please, can you show me example || tutorial?
(Reply) (Parent) (Thread)
[User Picture]From: carlogulliani
2009-01-09 07:57 pm (UTC)
(Reply) (Parent) (Thread)