• 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: Find and replace string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Find and replace string


  • Subject: RE: Find and replace string
  • From: "Ed Walter" <email@hidden>
  • Date: Tue, 1 Nov 2005 13:23:04 -0600
  • Thread-topic: Find and replace string

Title: Find and replace string
Just write a function for this:
 
on ReplaceText(theString,fString,rString)
   set current_Delimiters to applescript's text item delimiter
   set applescript's text item delimiters to fString
   set sList to every text item of theString
   set applescript's text item delimiters to rString
   set newString to sList as string
   set applescript's text item delimiters to current_Delimiters
   return newString
end ReplaceText
 
set vbcrlf = ascii character(13) & ascii character(10)
strString = "Hello^Mum"
strString = ReplaceText(strString, "^", vbcrlf) of me
 
-ed-


From: applescript-users-bounces+ewalt=email@hidden on behalf of Steve Foster
Sent: Tue 11/1/2005 10:56 AM
To: AS users list
Subject: Find and replace string

Hi

I am trying to work out a simple find and replace script.

I need it to replace a ^ with a carriage return.

I am a VBScript developer and would usually use something like:

____________________________________
strString = "Hello^Mum"

strString = Replace(strString, "^", vbcrlf)
____________________________________

Everything I can find on the list seems overly complicated for such a
simple task (using RegExp and shell script).

Any ideas?

Thanks

steve


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

 _______________________________________________
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

  • Prev by Date: Re: Find and replace string
  • Next by Date: Re: strange location indexes
  • Previous by thread: Re: Find and replace string
  • Next by thread: Re: Find and replace string
  • Index(es):
    • Date
    • Thread