• 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: TextEdit Slash SearchReplace impossible (was Basic Script Blues)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit Slash SearchReplace impossible (was Basic Script Blues)


  • Subject: Re: TextEdit Slash SearchReplace impossible (was Basic Script Blues)
  • From: ba95 <email@hidden>
  • Date: Sat, 21 Nov 2009 05:40:33 +0100

Confirmation:

I want to replace a slash / (not a back slash \ )

Thanks for helping.

BA

Le 19 nov. 09 à 21:00, "Stockly, Ed" <email@hidden a
écrit :

Date: Thu, 19 Nov 2009 11:42:45 -0800
From: "Stockly, Ed" <email@hidden>

Thanks a lot Ed.



I often encounter the following OCR mistake: "equi/ibration"
instead of
"equilibration".

The following line does not work ("equi/ibration" is not found)

set TheText to my SearchReplace(TheText, "equi/ibration",
"equilibration")

There's nothing about this handler call that would cause it to fail, so the problem may be in the handler itself. Can you post the SearchReplace handler that generates the error?

Here it is

--
set TheText to the clipboard

set TheText to my SearchReplace(TheText, "eqUI/l", "equili")
-- Blah... Blah... (other SearchReplace operations)

set the clipboard to TheText

on SearchReplace(mainString, searchString, replaceString)
	set olddelis to AppleScript's text item delimiters
	set AppleScript's text item delimiters to (searchString)
	set theList to (every text item of mainString)
	set AppleScript's text item delimiters to (replaceString)
	set theString to theList as string
	set AppleScript's text item delimiters to olddelis
	return theString
end SearchReplace
--


Unless, is it possible that your OCR is returning a slash / rather than a backslash \ ?

A slash is an appleScript escape character and may be causing
problems.

The other SearchReplace operations do perform perfectly.

I do not think so, but I will pay attention next time.


_______________________________________________
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
  • Follow-Ups:
    • Re: TextEdit Slash SearchReplace impossible (was Basic Script Blues)
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: iTunes script problems
  • Next by Date: Re: how to convert *space* to
  • Previous by thread: Re: As Alias List
  • Next by thread: Re: TextEdit Slash SearchReplace impossible (was Basic Script Blues)
  • Index(es):
    • Date
    • Thread