Re: Faster way to replace text in AppleWorks?
Re: Faster way to replace text in AppleWorks?
- Subject: Re: Faster way to replace text in AppleWorks?
- From: Malcolm Fitzgerald <email@hidden>
- Date: Mon, 30 Sep 2002 23:40:19 +1000
Thanks Jay!
That looks like a promising way to solve the problem. My initial
concern with doing it this way is that I might lose the text
formatting when massaging the text in a variable. We'll see how it
goes. Thanks again.
Dale
Of course your text formatting will be lost. This crowd don't give a
shit about text formatting.
Apart from the three or four who'll care enough to berate me for
drawing unwonted conclusions and the other two who are upset by
swearing you can be sure that the rest of the people on this list
think that formatting is done to make the text pretty not meaningful
[1]. Bold is "kissing in public" isn't it? The fact that the factual
and literal meaning of the formatted text is lost using their
text-replacement methods is neither here nor there to the OO or the
procedural crowds. You won't find succour in either camp.
You'll have to protect your text styles by getting and setting
everything "as styled text" so that you can discover the styles and
reassert them yourself or you do it the very slow way and let the
application handle the replacements. Getting and setting is hard on
the muscles inside your head and takes forever to get right but
produces a good result (thanks Arthur). Using the programme is easier
on the old noggin and programmed in a flash but slower on each run.
Choose according to your needs.
[1] Don't expect me to find my manners in a footnote!
On Monday, September 30, 2002, at 06:51 AM, Jay Young wrote:
Hi Dale,
I would recommend using the AppleScript Text Item Delimiters. If
your document isn't too big, you could store all the text in a
variable and then fix it with the Text Item Delimiters and then put
it back in AppleWorks. I tested this code in OS 10.2.1 with AS 1.9
and it seemed to work okay.
Please take notice of what Michelle Steiner has asked. If you
have commas in any numbers, or even periods in email addresses, the
Script will put a space after these characters too.
In the end, this code should change a period, comma, and question
mark to a period-space, comma-space, and question mark-space. It
will then look for any 2 spaces next to each other and change them
to 1 space in a repeat loop until the document only contains 1
space in every space location. I don't know if this is really what
you're looking for, but hopefully it will at least give you some
ideas for a solution.
--------------------------------------------
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
--
--
Malcolm Fitzgerald email@hidden
Database Manager
http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.