I want to be able to choose a folder containing (among others) images. These images should be listed in a table according to their posix path. It’s based on ben Waldie’s table example but with a lot of extentions.
set theFolder to choose folder without invisibles
tell application "Finder"
set theFiles to every file of theFolder <== problem 1
set theTableViewContents to {}
repeat with a from 1 to length of theFiles
set theCurrentFile to item a of theFiles
set theCurrentFileName to name of theCurrentFile <== problem 2
set end of theTableViewContents to {theCurrentFileName, theCurrentFile as string}
end repeat
end tell
-
problem 1:
I’m trying to do: set theFiles to every file of theFolder whose file type is in {“JPEG”, “TIFF”}
I can’t get this to work. -
problem 2:
the files displayed are in the form “Macintosh HD:Users:…” (etcetera), where I want them to be “/Macintosh HD/Users/…” (etcetera)
When working with the choose file option (with multiple selection) I have no problem getting the above to work, but I can’t get it working on an entire directory with choose folder.