MACSCRPT Archives

October 2006

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:
Bill Steele <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sun, 22 Oct 2006 17:38:29 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
>>I've been using ACME Script Widgets' "ACME Replace" command for so long I
>>barely remember how to search and replace strings within strings in vanilla
>>AS. However, I find myself needing to do that, because my ACME Replace
>>commands are hanging in some of my newer scripts in OS 10.3.8. (They never
>>error out; the script just never finishes running, and then script editor
>>crashes.)
>
>Maybe you can choose to switch to Satimage.osax.



One reason to want ACME replace is to do lists, as in
set foo to Acme Replace {"<p>","<br>"} in foo substitution text ""

It hangs sometimes if the search target is not present. One solution 
is to wrap the command in an if block, as

if foo contains "whatever"
Acme Replace "whatever" etc.
end if

I just found out that you can simulate the list in Satimage with a second list:

set foo to change  {"<p>","<br>"} into {"",""} in foo


-- 

Bill Steele
[log in to unmask]

ATOM RSS1 RSS2