I'm trying to automatize opening of certain documents from a folder. Here is the code below which does the job however if there is a sub-folder in a folder it opens it too.
If there is a way to "filter out" folder from the list of files I'm getting in the second line of code?
If there is a way to "filter out" folder from the list of files I'm getting in the second line of code?
Code:
set doc_path to (path to documents folder) & "Server" as string
set list_of_documents to list folder doc_path without invisibles
tell application "TextEdit"
repeat with a_file in list_of_documents
set a_doc to doc_path & ":" & a_file
open a_doc
end repeat
set miniaturized of window 1 to true
end tell