Re: How to compare contents of a folder against a list?
Re: How to compare contents of a folder against a list?
- Subject: Re: How to compare contents of a folder against a list?
- From: "Stockly, Ed" <email@hidden>
- Date: Wed, 02 May 2007 13:16:42 -0700
- Thread-topic: How to compare contents of a folder against a list?
Title: Re: How to compare contents of a folder against a list?
> I have a folder with 736 images in them and am trying to write a script that
> will give me a report if I am missing anything.
Here's an example that should be pretty fast, using plain vanilla AppleScript. You'll need to modify it to suit your purposes, of course.
For large lists (and 736 is getting up there) you may find it faster to use the List & Records Tools scripting addition from Late Night Software.
Once you've generated your two lists try
difference of listA and listB
That will give you a list of items in one list, but not the other.
It could be a bit faster than vanilla appleScript.
HTH,
ES
-----------------
set myFolder to alias "Jaguar:Users:edstockly:Library:ScriptingAdditions:"
set myOtherFolder to alias "Jaguar:Library:ScriptingAdditions:"
tell application "Finder"
set myFileNames to the name of every item of myFolder
set listOfFiles to the name of every item of myOtherFolder
end tell
if the class of myFileNames is not alias then set myFileNames to {myFileNames}
set filesNotFound to {}
repeat with thisName in myFileNames
if thisName is not in listOfFiles then set the end of filesNotFound to thisName as Unicode text
end repeat
repeat with thisName in listOfFiles
if thisName is not in myFileNames then set the end of filesNotFound to thisName as Unicode text
end repeat
set AppleScript's text item delimiters to return
display dialog filesNotFound as string
--requires list & records tools OSAX
difference of myFileNames and listOfFiles
_______________________________________________
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