I want to list a bunch of files in a folder which I have managed to do. Open the first file from the list perform an action on the file close it then open the next one in the list and rise and repeat till all files in the list have been processed.
I have the following below, but not sure on what or how I would run the repeat.
Any help would be appreciated.
-- Select Source Folder
tell application "Finder"
activate
set the source_folder to (choose folder with prompt "Please Choose A Source Folder" without multiple selections allowed and invisibles)
end tell
-- Select Destination Folder
tell application "Finder"
activate
set the output_folder to (choose folder with prompt "Please Choose A Destination Folder" without multiple selections allowed and invisibles)
end tell
-- Tell finder to list all files in folder
tell application "Finder"
try
set myList to files of entire contents of source_folder as alias list -- works for many
on error -- if there is only one file in the folder "as alias list" fails.
set myList to files of entire contents of source_folder as alias as list -- works for one
end try
end tell
-- Tell Application to open first file in myList, perform action close file then repeat by opening next file in list and so on