Re: Comparing Two Lists
Re: Comparing Two Lists
- Subject: Re: Comparing Two Lists
- From: Daniel Robinson <email@hidden>
- Date: Mon, 12 Mar 2001 00:13:45 -0500
David,
I had the same problem cleaning up the debris college students leave on 60 Macs.
I ultimately discovered that the folders from "Startup Disk" were in no particular
order. Notice "TheGoodList" is in alpha order already.
after sorting "TheFolders" my script worked fine.
Hope this helps,
--Dan
------------------------------------------------------------------------
set TheGoodList to --<cmd-L>
{folder "Applications" of startup disk, folder "Documents" of startup disk,
--<cmd-L>
folder "Internet" of startup disk, folder "Storage" of startup disk, --<cmd-L>
folder "System Folder" of startup disk, folder "Utilities" of startup disk} as
list
set TheFolders to every item of startup disk as list
set TheFolders to sort TheFolders by name
if TheFolders = TheGoodList then
--DO NOTHING
else
--DO STUFF
------------------------------------------------------------------------
>
I am trying to compare two lists
>
NameList is the source list for a search.
>
list1 is a list of files found and copied to FOLDER 2.
>
What i am trying to do is to compare list1 to nameList and
>
find out what files where not found and then generate a report on the missing
>
files.
>
>
tell application "Scriptable Text Editor"
>
>
tell document "Pickup List"
>
>
set nameList to word 1 of every paragraph
>
>
end tell
>
end tell
>
tell application "Finder"
>
>
set list1 to name of files in folder "FOLDER 2" of disk "AdPro-15"
>
>
if list1 does not contain nameList then
>
>
end if
>
end tell