Re: converting & into &
Re: converting & into &
- Subject: Re: converting & into &
- From: Tommy Bollman <email@hidden>
- Date: Tue, 13 Jul 2010 17:27:32 +0200
There must some tool out there that can do the conversion from
Somewhere here (http://homepage.mac.com/tkurita/scriptfactory/) there is a file called HTMLElement, I have tried to find it, but I couldn't.
I suggest you just use something from here: -- http://macscripter.net/viewtopic.php?id=24725 Using AppleScript's Text Item Delimiters
like this one, and use it multiple times until you have removed the two? offenders.
to swapText(theText, swapOut, swapIn)
(* This bit comes from Apple's own "Replace Text in Item Names" script
with some of the variables changed to make it a call-able handler *)
if the theText contains the swapOut then
-- replace target string using delimiters
set AppleScript's text item delimiters to the swapOut
set the text_item_list to every text item of theText
set AppleScript's text item delimiters to the swapIn
set the theText to the text_item_list as string
set AppleScript's text item delimiters to ""
end if
return theText
end swapText
hopes this helps.
Den 13. juli 2010 kl. 16.20 skrev Bert Groeneveld
> Hello,
>
> In the following example the variable my_XML_file is an xml file that contains text like this:
> & and >
> I want to read the contents of the xml file and store it in the new variable myContent so that & is converted to a simple & and > is converted to a simple >.
> I found somewhere on the Internet as <<class utf8>> (which is good for keeping the euro sign), but that doesn't help me.
> Who can help? Is it anyway possible?
>
> Bert.
>
> set openedFile to open for access my_XML_file
> set myContent to read openedFile as «class utf8»
> close access openedFile _______________________________________________
> 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
Best regards
Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.
_______________________________________________
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