我正在开发一个保持打开(空闲)的applescript来监视一个文件夹并处理每个传入的项目。但是,如果有的话,我无法遍历传入的文件。如何解决这个问题?
on idle
tell application "Finder"
-- Folders
set InFolder to "Macintosh HD:Users:Nick:Documents:Applescript:Beeld bewerken:In:"
set OutFolder to "Macintosh HD:Users:Nick:Documents:Applescript:Beeld bewerken:Out:"
set MyFiles to (every file in folder ((InFolder) as text))
set MyFiles to MyFiles as list
set NumberOfFiles to (number of files in folder ((InFolder) as text))
end tell
if NumberOfFiles > 0 then
repeat with i in MyFiles
tell application "Adobe Photoshop CS6"
open (item i of MyFiles)
-- Edit item
end tell
end repeat
end if
return 10
end idle