Hi all,
Newbie applescripter here and I really need help
I’ve been ‘coding by example’ searching through google for different Applescript samples, but this one is eluding me.
I’m trying to get the finder to return say 5 .txt files from a folder. Here’s my attempted code :
tell application "Finder"
set thePath to folder MyFolder
set txtFileList to files 1 thru 5 in thePath whose name ends with ".txt"
end tell
return txtFileList
(MyFolder is a folder name passed into this function)
I am able to get every file with .txt extension - i.e. this works fine:
set txtFileList to every file in thePath whose name ends with ".txt"
But for some reason i cant get it to limit the results to a fixed number of files. (There are more than 5 files in the folder)
I’m using this snippet to process text files one at a time but the script takes too long when processing all files, so i need to limit the processing down to manageable chunks.
Can anyone pleeease help?
Thanks
Drav