Koodi: Valitse kaikki
property kuvat_raw : "CR2"
property kuvat_xmp : "xmp"
property kuvat_jpeg : "jpg"
property videot : {"MOV", "THM"}
property kansio_raw : "RAW"
property kansio_jpeg : "JPEG"
property kansio_mov : "MOV"
property kansio_low : "LOW"
on adding folder items to kuvakansio after receiving kamat
repeat with kama in kamat
tell application "Finder"
if (the name extension of the kama is in the kuvat_raw) then
set the tiedosto to the name of kama
try
set komento to ("sips -s format jpeg " & tiedosto & " --resampleWidth 1000 --out " & kansio_low)
do shell script komento
on error virhe
display dialog virhe
end try
try
move file kama to folder kansio_raw
on error virhe
display dialog virhe
end try
end if
if (the name extension of the kama is in the kuvat_xmp) then
move file kama to the kansio_raw
end if
if (the name extension of the kama is in the kuvat_jpeg) then
move file kama to the kansio_jpeg
end if
if (the name extension of the kama is in the videot) then
move file kama to the videot
end if
end tell
end repeat
end adding folder items to
- sips antaa virheilmoituksen "Warning: IMG_4480.CR2 not a valid file - skipping. Error 4: no file was specified. Try 'sips --help' for help using this tool". Vastaava komento tiedoston nimellä toimii Terminalissa.
- move ei tuolla anna virheilmoitusta, mutta ei tee mitään.
Osaisko joku jeesata, järki lähtee.