find/replace strings in TexEdit+ ... but no!

Note, I’m using TexEdit+, not TextEdit

Doing simple string replacements with this:


set searchList to {"@TEXT 10/12 PT:<f\"ITC Franklin Gothic Demi\">1 Year	3 Years	<f$><f\"ITC Franklin Gothic Demi\">5 Years	<f$><f\"ITC Franklin Gothic Demi\">10<\\!s>Years"}
set replaceList to {"@example table head_4Col:	1 Year	3 Years	5 Years	10 Years"}
tell application "Tex-Edit Plus"
	activate
	tell window 1
		repeat with x from 1 to the number of items in replaceList
			replace replacing with item x in replaceList looking for item x in searchList ¬
				with cases matching and whole words matching
		end repeat
	end tell
end tell

…or I thought they were simple.

I need to search for some strings that contain backlashes (QuarkXPress tags), but I think TE+ needs me to coerce them somehow.
I thought the way to do that was with an extra "" preceding it, but that doesnt seem to work with TE+. (I keep getting “Can’t make some data into expected type”)

That error msg sounds like a coercion issue, right?

Hope anyone knows / can help.

Hello.

I have figured out the error: Tex-Edit Plus requires International text for its replace command, the script is using Unicode text.
One or more of the characters you are looking for are having a different encoding in International Text, (It may even not exist a character with that mapping there. And that is what makes Tex-Edit plus balk at your replace string.

Hopefully some friendly soul who knows how to coerce text to International text, or any other means of overcoming this problem, will pass by. :slight_smile:

Or maybe it is time to give TextWrangler a closer look. :frowning:

-But TextWrangler is great! :smiley:

Thnks Mcusr.

I’ll write the developer, see what he thinks.

Hello Autofetischist.

It would be very nice if you could post an eventual work around for that problem if he got one, -thinks he has one.

Thanks.