Hi,
i have just stupid question - I am trying to convert and resize folder of images to (or less) then given size. But I have problem by given size of files from Finder - it does not returns the changed file size, it returns still the same size. Please does anyone has answer for me. Look at the code (using the GraphicConverter)
tell application “GraphicConverter”
activate
repeat with i from 1 to loopFinish
set currentFile to item i of fileList
set the tempFile to the name of currentFile
tell application “Finder”
set datS to size of item i of fileList as integer
end tell
open currentFile as alias
set picDim to image dimension of window tempFile
set picHor to item 1 of picDim
set picVert to item 2 of picDim
if picHor > picVert then
set newVert to round ((hor / picHor) * picVert)
set newHor to hor
else
set newVert to hor
set newHor to round ((hor / picVert) * picHor)
end if
set image dimension of window tempFile to {newHor, newVert}
set qual to 100
if datS > 10000 then
repeat with y from 1 to 50
set JPEG quality of window tempFile to qual
set qual to qual - y
save window tempFile as JPEG with wwwready
set datS1 to data size of file in window tempFile
tell application "Finder"
set datS to size of file tempFile in folder pathName
set datS to datS as integer
end tell
end repeat
end if
close window tempFile
end repeat
end tell