MACSCRPT Archives

February 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 19 Feb 2008 15:56:47 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (1 lines)
On Feb 19, 2008 3:13 PM, Levon Spradlin <[log in to unmask]> wrote:
> set charInput to «data utxt00BA»
> set charOutput to «data utxt00B0»

If you're on Leopard, note that you can use

set charInput to character id 186
set charOutput to character id 176

>             repeat with p from 1 to count of pages
>                 repeat with a from 1 to count of text boxes
>                     repeat with c from 1 to count of characters
>                         if c is charInput then

c will never be charInput; c will be equal to the numbers 1, 2, 3, 4,
5 . . . up to the size of each text box.  You want to test if
"character c of text box a of page p" is equal to charinput.  First
you need to qualify your inner loops, though.  "repeat with a from 1
to count of text boxes of page p", "repeat with c from 1 to count of
characters of text box a of page p", or something.

But the usual way to do this would be to set text item delimiters to
charInput, turn the text into a list of text items, set the text item
delimiters to charOutput, and then coerce the list of text items back
to text.

-- 
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2