How to compare contents of a folder against a list?
How to compare contents of a folder against a list?
- Subject: How to compare contents of a folder against a list?
- From: "Patrik B." <email@hidden>
- Date: Fri, 4 May 2007 02:11:28 -0700
Thanks for your help guys! Below is the final version I ended up using, I
prefer not to use scripting additions so my scripts always run no matter
what the local set up is. Also even though I ran it with 53 images in my
master set against 734 it took less than a minute to run so is fast enough.
Saves me hours in going through them all one by one.
property myprefixlist :
{"DAN", "DUT", "ENG", "FRE", "GER", "GRE", "HEB", "HUN", "ITA", "JAP", "LAT",
"NOR", "POR", "RUS", "SPA", "SWE"}
set missingfiles to {}
set mylist to {}
tell application "Finder"
set masternames to name of (every file of entire contents of (choose
folder with prompt "Pick your master folder."))
set filenames to name of (every file of entire contents of (choose
folder with prompt "Select the foreign images folder."))
end tell
repeat with aprefix in myprefixlist
repeat with aName in masternames
repeat 1 times
set temp to (contents of aprefix & "-" & contents of
aName)
considering case
if temp is in filenames then exit repeat --
if file is present
set end of missingfiles to temp -- if file
is not present
end considering
end repeat
end repeat
end repeat
set mycount to count of missingfiles
repeat with i in missingfiles
set text item delimiters to ":"
set end of mylist to i & "\r"
set text item delimiters to ""
end repeat
display dialog "List of missing images:" default answer (items of mylist as
string) & "A total of: " & mycount as string
_______________________________________________
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