If you do not want to have a shell script.
Here another script , I did the same test script as my other --> filtering:1 minute, moving:20 seconds.
------------------------------
set rootFolder to alias "hard Drive:users:yourname:path:to:source folder:"
set destFolder to alias "hard Drive:users:yourname:path:to:destination folder:"
main(rootFolder, destFolder)
onmain(rootFolder, destFolder)
script o
property tNames : missing value
property fileList : missing value
property thislist : missing value
on getfirstPar(s)
set x to ""
settidtotext item delimiters
set text item delimiters to {"\\0" & s}
try
set x to text item 2 of my tNames
set text item delimiters to {"\\0"}
set x to s & (text item 1 of x)
end try
settext item delimiterstotid
return x
end getfirstPar
endscript
tell application "Microsoft Excel"
tellworksheet 1 ofactive workbooktoseto's fileListtovalueofused range
endtell
tell application "System Events" to set o's tNames to name of files of rootFolder
settidtotext item delimiters
settext item delimitersto "\\0"
seto's tNamesto "\\0" & o's tNames -- convert list to string, name separated by NULL
settext item delimiterstotid
set tc to (count o's fileList)
repeatwithifrom 1 totc
set o's thislist to item i of o's fileList
set tc2 to (count o's thislist)
repeat with j from 1 to tc2
settnametoo's getfirstPar(itemjofo's thislist) -- search in tNames, return the first paragraphs that begin with this name
if tname is not "" then tell application "System Events"
move file tname of rootFolder to destFolder
end tell
end repeat
endrepeat
endmain