MACSCRPT Archives

November 2012

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:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 13 Nov 2012 22:57:44 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (37 lines)
-->>I have a script that goes through a humungous test file looking for
stuff.  Simple version:

Depending on what the "do some stuff with it" does, this might simplify
things. It definitely tells you if your keywords are in the part of bigfile
you're looking at. Don't know how big humungous is, but it works on a pretty
large file OMM.

ES

set keywords to {"foo", "bar", "Fred"}
set AppleScript's text item delimiters to {"whatever"}
set thePieces to text items of bigFile
repeat with onePiece in thePieces
    set AppleScript's text item delimiters to keywords
    set onePieceItems to text items of onePiece
    if (count (onePieceItems)) > 1 then
        --    (do some stuff with it)
    end if
end repeat


On 11/13/12 1:15 PM, "Bill Steele" <[log in to unmask]> wrote:

> I have a script that goes through a humungous test file looking for stuff.
> Simple version:
> 
> set keywords to {"foo","bar","Fred"}
> set thePieces to splittext bigFile using "whatever"
> repeat with onePiece in thePieces
> repeat with oneWord in keywords
> if onePiece contains oneWord
> (do some stuff with it)
> end if
> end repeat
> end repeat

ATOM RSS1 RSS2