MACSCRPT Archives

May 2010

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 10 May 2010 13:19:01 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (24 lines)
set myFile to choose file with prompt "Select an XML file"
This will work with multiple lines:

set myText to {"one:two:three:four:five:"}
set the end of myText to return & "abc:def:"
set the end of myText to return & "ghi:jkl:"
set the end of myText to return & "mno:pqr:"
set the end of myText to return & "stw:xyz:" & return
set AppleScript's text item delimiters to {""}
set myText to myText as text

-- myText is 6 lines of text

set xmlString to (read myFile)

set xmlString to (read myFile)
set AppleScript's text item delimiters to {return}

set myText to every text item of myText
set AppleScript's text item delimiters to {xmlString & return}
set newText to myText as string

 

ATOM RSS1 RSS2