Im sure this will have been done better by some one before. In trying to help someone here in forum a problem I’ve had before came up again when trying a few tests.
Here is the scenario say I want 2 lists from a folder.
List 1 to contain files of (known creator type or missing value) + Extension
List 2 to contain files of (known creator type) + Extension
The second list I can get to work but my questions are have I gone about this the right way? Would “file type” be better than “Extension” as I would need to list .jpeg & .jpg? and can I quote a missing value? to one of my property lists. Hope I’ve made some sort of sense of this!!!
property CreatorType : {"", "8BIM"} -- How do I get missing value to this?
property OtherTypes : {"ART5", "CARO", "XPR3"}
property FileTypeList : {"8BIM", "BMP ", "EPSF", "GIFf", "JPEG", "PICT", "PCX ", "PNGf", "8BPS", "PXR ", "PRAW", "SCRN", "..CT", "TPIC", "PDF ", "8BPS", "TIFF"}
property ExtensionList : {"", "ai", "bmp", "eps", "gif", "jpg", "pct", "pcx", "png", "psd", "pxr", "raw", "rsr", "sct", "tga", "pdf", "psd", "tif"}
--
set inputFolder to choose folder with prompt "Where's the images folder?"
tell application "Finder"
set MyImageFiles to (every file of entire contents of inputFolder) as alias list
end tell
--
set PSformats to {}
tell application "Finder"
repeat with this_item in MyImageFiles
set x to properties of this_item
if name extension of this_item is in ExtensionList and creator type of this_item is in CreatorType then copy (this_item as string) to end of PSformats
end repeat
end tell
return PSformats
--
set RasterThis to {}
tell application "Finder"
repeat with this_item in MyImageFiles
set y to properties of this_item
if name extension of this_item is in ExtensionList and creator type of this_item is in OtherTypes then copy (this_item as string) to end of RasterThis
end repeat
end tell
return RasterThis