renaultssoftware
08-23-2010, 08:02 AM
Hi all.
The script below is supposed to go through a giant folder, with image files that are supposed to be 512x512. If not, they go to the trash.
Problem is, instead of opening in ImEv, the files open in Preview and that throws an error.
Any fixes?
tell application "Finder" to set x to every file of the folder (POSIX file "/Users/Slave/icons")
set u to {}
tell application "Image Events"
repeat with i in x
set y to open i
if the dimensions of y is not {512, 512} then
copy i to the end of u
end if
close y
end repeat
end tell
tell application "Finder" to delete u
Thanks!
The script below is supposed to go through a giant folder, with image files that are supposed to be 512x512. If not, they go to the trash.
Problem is, instead of opening in ImEv, the files open in Preview and that throws an error.
Any fixes?
tell application "Finder" to set x to every file of the folder (POSIX file "/Users/Slave/icons")
set u to {}
tell application "Image Events"
repeat with i in x
set y to open i
if the dimensions of y is not {512, 512} then
copy i to the end of u
end if
close y
end repeat
end tell
tell application "Finder" to delete u
Thanks!