• 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: converting & into &
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:
> &amp; and &gt;
> I want to read the contents of the xml file and store it in the new variable myContent so that &amp; is converted to a simple & and &gt; 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

References: 
 >converting &amp; into & (From: Bert Groeneveld <email@hidden>)

  • Prev by Date: Re: converting &amp; into &
  • Next by Date: Where would just store AppleScripting scripts property list files
  • Previous by thread: Re: converting &amp; into &
  • Next by thread: Where would just store AppleScripting scripts property list files
  • Index(es):
    • Date
    • Thread