Any help on this, I am running a script to select files that have been modified a day previous but when I run this script I get an error saying, "Cannot get every file of “PATH TO MY FOLDER”. I know the path is correct as the MySavePath is in the same place and that one works. Any help? thanks!
property MyFolderPath : "PATH TO FOLDER:"
property MySavePath : "PATH TO FOLDER"
--open the files
on run
set dateStamp to ((current date))
set theFolder to MyFolderPath
set theFiles to every file of theFolder whose modification date is less than dateStamp
processfiles(theFiles)
end run
on processfiles(theFiles)
--where eps files are saved to
set choicePath to theChoice as string
set theChoice to MySavePath
-- now you have a list of all new files, so check their types:
--create a list of the files you are going to process
set theFiles to theFiles as list
repeat with aFile in theFiles
set aFile to aFile as alias
set dropPath to choicePath
set dupNames to {}
set moveToPath to dropPath
set modTime to (current date) as string
end repeat
--open illustrator and begin eps conversion
tell application "Illustrator CS"
activate
property MyFolderPath : "PATH TO FOLDER:"
property MySavePath : "PATH TO FOLDER"
--open the files
on run
tell application "Finder"
set dateStamp to ((current date))
set theFolder to MyFolderPath as alias
set theFiles to every file of theFolder whose modification date is less than dateStamp
end tell
processfiles(theFiles)
end run
THANKS! That did it… But my code is only processing the last file in the folder, am I missing something… There are 3 files in the folder that have a modified date of earlier than today… Any help?
UPDATE:
Had an end repeat in the wrong place. It works like a charm now… THANKS EVEYONE…
on run
tell application "Finder"
set dateStamp to ((current date))
set theFolder to MyFolderPath as alias
set theFiles to every file of theFolder whose modification date is less than dateStamp
end tell
processfiles(theFiles)
end run
on processfiles(theFiles)
--where eps files are saved to
set theChoice to MySavePath
set choicePath to theChoice as string
--create a list of the files you are going to process
set theFiles to theFiles as list
repeat with aFile in theFiles
set aFile to aFile as alias
set dropPath to choicePath
set dupNames to {}
set moveToPath to dropPath
set modTime to (current date) as string
end repeat
EDIT - I saw the above update after posting the following.
I’m not sure, could you post the event log? Are you trying to save each file to a new location?
For what it’s worth, I tried to clean up the script:
on run
tell application "Finder"
set theFolder to MyFolderPath as alias
set theFiles to (files of entire contents of theFolder whose modification date is less than (current date)) as alias list
end tell
processfiles(theFiles)
end run
on processfiles(theFiles)
--where eps files are saved to
set theChoice to MySavePath
set choicePath to theChoice as string
repeat with aFile in theFiles
set dropPath to choicePath
set dupNames to {}
set moveToPath to dropPath
set modTime to (current date) as string
end repeat
end processfiles