find/replace in comments of file?

: Ok, Marc/Rob. I’ve extracted the portion that does the grunt work form Marc’s
: fantastic example. (I’m going to be incorporating it into another script).
: It’s working in this form, but only on the FIRST instance of
: “Dept” in the comments, but it DOES run through all the files in
: a selection.
: So, how do I extend it to act on ALL instances of “Dept” in the
: comments?
: It LOOKS like it should be doing this in the “repeat with i from 1 to
: count commList” line, but it doesn’t happen. What am I missing?

[code snipped 'cause it didn’t look good in the reply]
Without doing a complete mockup, I’d guess that you need an else
statement in the repeat loop in question (repeat with i from 1 to count
commList).
On an unrelated note, it appears that there’s a Finder tell within a Finder
tell (the entire script is within a Finder tell block). Since I prefer to keep the
Finder out of stuff as much as possible, I’d look through the script and
possibly break it down to Finder/non-Finder blocks.
Just my 2 cents,
Rob

: Ok, Marc/Rob. I’ve extracted the portion that does the grunt work form Marc’s
: fantastic example. (I’m going to be incorporating it into another script).
: It’s working in this form, but only on the FIRST instance of
: “Dept” in the comments, but it DOES run through all the files in
: a selection.
: So, how do I extend it to act on ALL instances of “Dept” in the
: comments?
: It LOOKS like it should be doing this in the “repeat with i from 1 to
: count commList” line, but it doesn’t happen. What am I missing?
[snip the code 'cause it looked ugly in the reply]
T.J.,
Your snippet works as desired on my setup (without modification).
OS 9.1/AppleScript 1.6
– Rob