on foo() tell application "Finder" set folderPath to (path to movies folder as text) & "Test:" as alias set aList to name of files of folderPath as list set AppleScript's text item delimiters to return return ".scpt" is in (aList & return as text) end tell end foo set i to foo() display dialog i as text