1 Reply Latest reply: Jan 2, 2013 11:14 AM by Jacques Rioux
macdaddy Level 2 Level 2

Dear All,

 

I have a number of videos, a rather.. large number.

 

I would like to organize them by video resolution into three folders, 1080p, 720p, and others

 

I could drag and drop meself by that would take rather... long.

 

anyone know a way to perform this using automator?

 

thaks


MacBook Air, OS X Mountain Lion (10.8.2)
Reply by Jacques Rioux on Jan 2, 2013 11:14 AM Helpful

Hi,

 

This is not possible with Automator without script.

 

If Quicktime read these videos, you can use this AppleScript script:

-----------------

-- *** 3 destination folders *** 
-- from the Finder drap/drop a folder between double quotes in each line
set dest1 to (POSIX file "") as alias --<-- 1080p video folder
set dest2 to (POSIX file "") as alias --<-- 720p video folder
set dest3 to (POSIX file "") as alias --<-- others video


set sourceFolder to (choose folder with prompt "Select a folder wich contains videos.")
tell application "System Events"
    repeat with tFile in (get files of sourceFolder)
        try
            set w to item 1 of (get dimensions of (first track of movie file (path of tFile) whose its duration is not {0, 0, 0, 0}))
            if w > 1079 then
                move tFile to dest1
            else if w > 719 then
                move tFile to dest2
            else
                move tFile to dest3
            end if
        end try
    end repeat
end tell

All replies

  • Jacques Rioux Level 4 Level 4
    expertise.macosx
    Mac OS X

    Hi,

     

    This is not possible with Automator without script.

     

    If Quicktime read these videos, you can use this AppleScript script:

    -----------------

    -- *** 3 destination folders *** 
    -- from the Finder drap/drop a folder between double quotes in each line
    set dest1 to (POSIX file "") as alias --<-- 1080p video folder
    set dest2 to (POSIX file "") as alias --<-- 720p video folder
    set dest3 to (POSIX file "") as alias --<-- others video
    
    
    set sourceFolder to (choose folder with prompt "Select a folder wich contains videos.")
    tell application "System Events"
        repeat with tFile in (get files of sourceFolder)
            try
                set w to item 1 of (get dimensions of (first track of movie file (path of tFile) whose its duration is not {0, 0, 0, 0}))
                if w > 1079 then
                    move tFile to dest1
                else if w > 719 then
                    move tFile to dest2
                else
                    move tFile to dest3
                end if
            end try
        end repeat
    end tell