Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Apple Final Cut Pro Legacy Using Automator (Leopard) with FCP for repetitive tasks

  • Using Automator (Leopard) with FCP for repetitive tasks

    Posted by Dustin Lau on April 26, 2008 at 8:54 pm

    I thought you all might be interested to know I’ve managed to use Automator’s new “Watch Me Do” feature in 10.5 (Leopard)
    to automate a rather complex sequence of events.

    It’s pretty useful for repetitive tasks like the one I’m doing now
    which is replacing a set of 4 pictures in a simple animated sequence,
    opening the inserted picture’s properties page,
    copying each picture’s filename (which has been strictly standardized for the execution of the next step)
    pasting it into Livetype, stripping away the .jpg to make it a “title” (ie Alexandre Pato.jpg becomes Alexandre Pato)
    saving as the same filename but replacing .jpg with .ipr,
    returning to FCP, importing the newly created livetype file,
    inserting it into the graphic sequence, repositioning and proceeding to the next item.

    Essentially, automator works very well if you can do everything with keyboard strokes,
    however I was suprised that certain steps that necessitated mouse clicking
    (ie when replacing template pictures with the new pictures with paste attributes->click contents)
    it worked very well.

    Because of certain ways that FCP works it is sometimes necessary to have certain conditions in place before the scripts work
    (eg auto-select tracks are toggled by cmd-numpad0,
    there is no absolute deselect or select,
    so if a sequence has all, none or some auto-select tracks enabled,
    you do not know how the shortcut cmd-numpad0 will react, either selecting all or deselecting all)
    In my case, I made it such that all working sequences had all auto select track disabled.

    That said, it opens a vast array of options which I think is very exciting in an incredibly nerdy way.

    Here is a full list of the commands automated in this script
    Prerequistes

    * Playhead on first frame of first image
    * Image sequence with 4 images to be inserted placed directly after it
    * Each nested sequence has image to be replaced selected

    Commands

    1. cmd-5 (select effects palette)
    2. cmd-3 (select timeline-the timeline needs to be selected but if i only put a cmd-3 when it’s already selected it deselects, hence the cmd-5 first as deselecting the effects palette does not affect the execution of the script.
    3. cmd-numpad1 (auto-select video track1)
    4. x (select image1)
    5. cmd-x (cut image)
    6. ctrl-g (close gap) This brings the next image adjacent to the image sequence to be processed after
    7. left arrow (playhead to last frame of the 5 layer image sequence)
    8. cmd-numpad1 (deselect auto-select video track 1)
    9. cmd-numpad2 (select auto-select video track 2)
    10. opt-enter (open video nest)
    11. opt-v (paste attributes of copied picture file to pre-selected placeholder picture)
    12. click (select contents)
    13. enter
    14. cmd-9 (open picture attributes)
    15. cmd-c (copy filename)
    16. escape
    17. mouse click livetype in dock
    18. esc (this is to close any file dialogs that might be open)
    19. cmd-2
    20. cmd-1 (same as selecting effects palette then timeline in FCP, selecting a non crucial window first to ensure that selecting desired window does not deselect it if it is already active)
    21. cmd-a (select all text)
    22. cmd-V (paste copied filename ie Ep 1 Connections Alexandre Pato.jpg)
    23. down (go to end of text)
    24. backspace x 4 (deletes .jpg)
    25. up x 2 (go to start of text)
    26. opt-delete x 3, then delete (deletes Ep 1 Connections )
    27. cmd-shift-s
    28. cmd-v, backspace x 4, enter (paste filename then delete .jpg, and enter)
    29. escape (clears any error dialog)
    30. click FCP in dock
    31. cmd-i (import)
    32. cmd-shift-g (go to folder)
    33. /Volumes/disc/folder/livetype
    34. cmd-2 (switch to detail mode-you should set it to sort by modified date from oldest to most recent)
    35. up (to select most recently created file)
    36. cmd-3 (switch back to 3 column mode)
    37. enter
    38. cmd-5
    39. cmd-4 (select file browser)
    40. enter (open imported livetype in viewer)
    41. cmd-3 (select timeline)
    42. home (move playhead to start of sequence)
    43. cmd-numpad3 (autoselect video track 3)
    44. x (mark placeholder livetype clip on track 3)
    45. F6-3 (set viewer video patch to video track 3)
    46. F10 (overwrite placeholder livetype)
    47. home, enter (select and open overwritten livetype file)
    48. cmd-shift-] x 2 (i’ve bound this to navigate tabs, this opens the motion tab)
    49. tab, 100, tab x 3, 250 (set scale to 100, location to x=0 y=250)
    50. cmd-5
    51. cmd-3 (select timeline)
    52. ctrl-w (close nested sequence tab)
    53. cmd-numpad2 (deselect autoselected video track 2 as in step 9)
    54. right (move to next image)

    the cycle repeats with the next image but selecting a different track in the image sequence.

    This process takes 8 minutes 26 seconds for automator to execute.
    I take about 3, but with more than 80 of these to do, it is very tedious so I scripted it to do about 12 episodes at once and left to do other errands.

    It has great possibilities for workflow optimization and repetitive tasks so I thought you all might be interested.

    Jamil Aziz replied 15 years, 7 months ago 5 Members · 19 Replies
  • 19 Replies
  • Steven Gonzales

    April 27, 2008 at 4:49 pm

    Thanks for such a detailed explanation. Honestly, I didn’t think you could accomplish this complex of a task in FCP.

  • Dustin Lau

    April 27, 2008 at 5:12 pm

    essentially, it’s not complicated but you just need to be clear the exact steps required.

    The hard part is that even your pauses are recorded, so you can’t take too long to think about the next step, or you’ll have to manually edit the pause duration after the record.

    Also, you sometimes need to pause longer so the software can catch to the steps executed, eg. opening a complex sequence, moving from a single video layer section to one that has many layers, etc

  • Mark Peysha

    July 30, 2008 at 3:40 pm

    Hey Dustin,

    Thanks for your entry on automator.
    Have you ever heard of anyone making an interface with automator, so that for instance you could trigger your mac to perform an automator function remotely?

    Thanks
    Mark

  • Dustin Lau

    July 30, 2008 at 4:46 pm

    There are a couple of ways to achieve this.
    First of all, you need to build a workflow of the script that you want to execute.

    This won’t be easy because you want to make sure it runs regardless of the situation the computer you’re running it on is currently in.

    The best test of this is to restart and see if it runs correctly from a fresh boot.
    This might even mean including commands to start FCP, etc.

    Now the part you’re interested in is how to trigger the script remotely.
    First of all you need to have remote access to the computer.
    If you have a static IP, this is easier.
    You only need to VNC, or login to your fileshare through your IP.

    However if you have a dynamically assigned IP, you can use a VPN or have your router forward your ip to a DNS for you to access. I recommend the VPN route, I use hamachix for this, it’s as easy as setting up an IM client.

    You can trigger the script by creating a workflow that searches a folder on your hard disk for files of a specific name.

    For example, you could share your documents folder and have the automator “Find Finder Items” action look for filenames that contain “Export”

    If you login to your fileshare remotely and create a text file in that folder named Export, it’ll trigger the Automator workflow to run. Then it’s just a matter of placing the actions you want run, after the “Find Finder Items” action.

    https://www.luminoir.com

  • Martin568

    March 19, 2009 at 12:44 pm

    Is there any way to make a repetitive exporting in FCP in tiger?
    I explain:
    I have 100 videos all the same long.
    I have to make some error fixing (the same in all videos) and re-export. Is there any chance tha automator makes my life easy?
    Thanks
    Martin

  • Dustin Lau

    March 19, 2009 at 3:13 pm

    Hi Martin,
    unfortunately, this feature of automator is only available in Leopard. You can use applescript to run keyboard commands, but programming it is nowhere near as easy and requires some knowledge of applescript programming.

    https://www.luminoir.com

  • Jamil Aziz

    October 7, 2010 at 2:21 pm

    Hi i am a MAC newby and am looking for all the help i can get.

    I would like to know if it possible to use Automator to the following task. Say in a sequence there are 1, 2, 3, 4, 5 and 6 clips. Then say i want to pick out clip 1, 3, 5 and place them at the end of clip 6. At the same time applyting slow motion to clips 1, 3 & 5 and inserting a transistion effect between clip 1, 3 and 5. Using Automator or another method is it possible to do this in one go using a short cut key? I do alot of wedding videos and this would be huge time saver for me.

    Thanks in advance!

  • Dustin Lau

    October 8, 2010 at 10:02 am

    Hi Jamil,

    do you want to cut 1,3,5 and put them behind 6, or do you want to copy them?
    is the time shift effect variable or consistent?

    The problem with doing a speed change is that you either have to open the speed change dialog box, or the motion tab after opening it in the viewer.

    Automator’s Watch Me Do sometimes has problems with dialog boxes because they don’t always open immediately and sometimes the programmed keystrokes occur before the dialog is open. That said, if you insert a long enough pause before entering the speed change percentage, it will still work, albeit a little slower.

    This is the keystroke sequence if you want to cut 1,3,5 to place behind 6, with speed change to 50%.

    You must have the timeline selected, all auto select tracks enabled.

    open automator, select record, then run these commands in FCP.

    home
    x
    ⌘x
    control g
    end
    ⌘v
    ⌘j
    50
    enter
    ⌘shift a
    home
    down arrow
    x
    ⌘x
    control g
    end
    ⌘v
    ⌘j
    50
    enter
    ⌘shift a
    home
    down arrow
    down arrow
    x
    ⌘x
    control g
    end
    ⌘v
    ⌘j
    50
    enter
    ⌘shift a
    up arrow
    v
    ⌘t
    up arrow
    v
    ⌘t

    https://www.luminoir.com

  • Jamil Aziz

    October 8, 2010 at 10:58 am

    Hi Dustin

    Many thanks for getting back to me.

    The clips i would like to copy after clip 6.

    I will try and follow your instructions, my new apple mac pro arrives next week and i will give this a go.

    Just one question for now the list of commands you gave me, should i follow them once i have activated watch me do? or do i start to record using watch me do and the list of commands are logged? also can i save this as a plug in for use on future projects?

    Your help is much appreciated.

    Jamil

  • Dustin Lau

    October 9, 2010 at 6:14 am

    Hi Jamil,

    You just need to open Automator. When you click the record button, Activator starts recording your keystrokes and mouse clicks.

    You might want to record just a short section to get used to it.

    What I normally do as a first step is to mouse click the FCP icon on the dock. This for some reason is the most reliable way to activate the application consistently, using the builtin launch command does not always work for some reason.

    The next thing I do is to activate the sound mixer window with opt 6, then the window I actually want (timeline, viewer or browser, etc)

    The reason is that you want to run the commands on the right window, but if you only put a ⌘3 to activate the timeline, you will close the timeline window if it’s already open. So I always use opt 6 to activate another window, then the keyboard shortcut which activates the correct window.

    You can save the automator file as .workflow or .app
    I normally save it as .app, then use Quicksilver to assign a keyboard shortcut to it.

    https://www.luminoir.com

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy