Note to self - don't wait 12 years to upgrade machines in the future...
You are using TextCommands on the Lion box? And you've tested it? It's sort of long-in-the-tooth, but then again Hamish wrote it.
There's a better way, that handles regex expressions? Pray tell, enlighten me.
tell application "Finder" to set nm to name of eachFile
tell application "Finder" to set knd to kind of eachFile as text
Tell the Finder once in a block. Don't make multiple calls unless necessary.
tell application "Finder"
set nm to name of eachFile
set knd to kind of eachFile as text
end tell
I asked this question several months ago (or was it years?) and was told it was not a significant time hit. The faster the processor the less significant?
set FileRef to open for access theFile
Don't open the file for access. Just read it. Opening is only necessary for writing.
I don't know how many files you're dealing with but if more than a few I'd probably grab a list of paths and then use regex to filter them rather than looping in the Finder.
Just following the example in Matt Neuburg's book Applescript, the Definitive Guide, page 371. Never said read meant open for access was optional. In Fact, it says under "open for access" :
Opens a file for read access – optionally, for write access …
I understood that to mean the open was for read and, if needed, for write.
I make changes and report back.
Thanks.