Hi all
Use this script (build it with VBA thanks to DJ)
set streamEditorCommand to " | tr [/:] [:/] "
set streamEditorCommand to streamEditorCommand & " | sed -e " & quoted form of (" s.:." & (POSIX file “/” as string) & “.” )
do shell script “find -E ‘/Users/rondebruin/Desktop/Ron’'‘s Folder’ -iregex ‘./[^~][^/]\.(xls|xlsx|xlsm|xlsb)$’ -maxdepth 1” & streamEditorCommand without altering line endings
In this example the name of the folder where I browse to is Ron’s Folder (with a apostrophe)
The script is not working if there is a apostrophe in the folder name and we must add a replace line in VBA to get it correct
ScriptToRun = Replace(ScriptToRun, “‘'’”, “‘\’'”)
So it looks like this
set streamEditorCommand to " | tr [/:] [:/] "
set streamEditorCommand to streamEditorCommand & " | sed -e " & quoted form of (" s.:." & (POSIX file “/” as string) & “.” )
do shell script “find -E ‘/Users/rondebruin/Desktop/Ron’\'‘s Folder’ -iregex ‘./[^~][^/]\.(xls|xlsx|xlsm|xlsb)$’ -maxdepth 1” & streamEditorCommand without altering line endings
Is this the way or is there another way that is better
If you want to see it working with VBA see : http://www.rondebruin.nl/mac/mac013.htm
Thanks