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: KOENIG Yvan <email@hidden>
- Date: Fri, 4 May 2007 11:37:02 +0200
Hello
With some small changes your script will run faster:
property missingfiles : {}
property mylist : {}
property masternames : {}
property filenames : {}
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 my myprefixlist
repeat with aName in my 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 my missingfiles to temp -- if file is not present
end considering
end repeat
end repeat
end repeat
set mycount to count of my missingfiles
repeat with i in my missingfiles
set text item delimiters to ":"
set end of my mylist to i & "
"
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
set masternames to {}
set filenames to {}
I assumes that some small complementary changes may be made because I
don't understand the need for a "repeat 1 times" loop.
repeat with aprefix in my myprefixlist
repeat with aName in my masternames
set temp to (contents of aprefix & "-" & contents of aName)
considering case
if temp is not in filenames then set end of my missingfiles to
temp -- if file is not present
end considering
end repeat
end repeat
Yvan KOENIG
_______________________________________________
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