set a to {"folder:folder:", "file", "folder:", "folder:folder:file"}
set isfolders to {}
set isfiles to {}
repeat with fileorfolder in a
if fileorfolder ends with ":" then
set isfolders to isfolders & fileorfolder
else
set isfiles to isfiles & fileorfolder
end if
end repeat
It's still a loop but it wouldn't need to talk to the Finder so
should be
faster. (Well... I think it should be faster!)
There's probably a way to combine "every item" and "ends with" to
achieve
this but I can't seem to find it.
Keep in mind that bundled files, such as applications will end with a
colon. I don't know if this is an issue or not. For example:
alias "Macintosh HD:Applications:Address Book.app:"
You can also find out if an item is a folder by using the "info for"
command, in the Standard Additions...
folder of (info for alias "Macintosh HD:Installer Log.txt")
--> false
folder of (info for alias "Macintosh HD:Applications:Address Book.app:")
--> true
package folder of (info for alias "Macintosh HD:Applications:Address
Book.app:")
--> true
You can also use the System Events application to find out if an item
is a folder...
tell application "System Events"
class of disk item "Macintosh HD:Applications:Address Book.app:"
end tell
--> file package
tell application "System Events"
class of disk item "Macintosh HD:Applications:"
end tell
--> folder
tell application "System Events"
class of disk item "Macintosh HD:Installer Log.txt"
end tell
--> file