Hello everyone, I’ve been trying to create a Folder Action Script that does the following:
- waits until the file has been transferred over to folder.
- checks the “natural dimensions” of the movie file.
- based on the dimensions of file (ex. 1920x1080 - 720x480), it will duplicate file to a specific folder.
The if/else statement will work on its own, however, when I include it as part of the “on adding folder items” script, it does not work
Here is what I have so far:
on adding folder items to thisFolder after receiving theItems
repeat with f in theItems
set Was to 0
set isNow to 1
repeat while isNow ≠Was
tell application "System Events" to set Was to size of f
delay 5
tell application "System Events" to set isNow to size of f
end repeat
tell application "Finder"
tell application "System Events"
set mov_dem to natural dimensions of movie file f
if mov_dem is {0, 0, 1920.0, 1080.0} then
tell application "Finder" to duplicate f to folder "HD files" of folder "SVR" of disk "MEDIA" with replacing
else if mov_dem is {0, 0, 720.0, 486.0} then
tell application "Finder" to duplicate f to folder "SD files" of folder "SVR" of disk "MEDIA" with replacing
end if
end tell
end tell
end repeat
end adding folder items to