Re: Using long lists in a script
Re: Using long lists in a script
- Subject: Re: Using long lists in a script
- From: Thomas Fischer <email@hidden>
- Date: Mon, 16 Nov 2009 17:30:23 +0100
Randy,
you might take a look at the Satimage osax (freely available).
There you have a function
exclude items v : remove strings from a list of strings. A list equivalent of the set difference.
which might do just what you need.
I haven't tested it myself, though.
Good luck
Thomas
Am 15.11.2009 um 21:31 schrieb email@hidden:
> Hello,
>
> I have to compare selected text against long lists of words in 25 different text documents and find out which words in the selection are not in a list. Each document contains about 4,000 words. Here is my basic script:
>
> set list1 to {"man", "dog", "automobile"}--actual list(s) will be around 4,000 words
> set list2 to {}
> set list3 to every word of (the clipboard)
> repeat with x from 1 to count of items of list3
> set n to item x of list3
> if n is not in list1 and n is not in list2 then
> set list2 to list2 & return & n
> end if
> end repeat
>
> I've searched the archives but can't find the answer to my question. What is the best way to get the words from those docs into my declared list(s)? Is there some way to use an external reference? A library, perhaps?
>
> Randy Lewis
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden