I wouldn't say stupid, especially considering some of the lulus I've pulled heh, but there are a few things I'd say about your code (even the one that *works*).
1. I am making an assumption here that you are on (some version) of windows. IF that is the case, know that paths generally follow the forward slash unix style "/", rather than the backwards slash windows only style "\"
2. liveme is correct, you need the folder, but you don't need the 'C:' part (unless you are specifically designating 1 disk from multiple drives)
3. Below is an example of how I would have done it (the fields are just for visual representation and could be any variable you wanted really)
Code: Select all
on openCard
# I did not have an already pre-determined folder,
-- you do, so the answer part would mean nothing for you...
answer folder "Choose a folder..."
if it is not empty then set the defaultFolder to it
put the files into field 1 # could be any variable...
# This is just the destination folder I made up, again, it is only for demonstration purposes...
put (specialFolderPath("Desktop") & "/CopiedFiles") into tmpFolder
# Here is the meat of the difference....
repeat for each line x in field 1
# your looking for a specific extension, .ncl. In this case, I am testing to see if the file contains ".txt"
-- if it does, then copy it from folder to folder
if x contains ".txt" then revCopyFile(x),tmpFolder
end repeat
# This part is unnescessary, again just for visual representation...
set the defaultFolder to tmpFolder
put the files into field 2
end openCard
And here is the visual representation of the above -
Hope that was of some help.