Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Apple OS X FCP Apple script question

  • FCP Apple script question

    Posted by Jj Johnson on September 29, 2016 at 11:00 pm

    I am attempting to write a applescript that will mark the in and out of a clip from a FCP timeline, get info to copy the name, export a quicktime, change the name of the export file to the copied name, add an underscore after the name, then add a unique number (date/time or preferably the number of the files in the folder where I am putting the new export – hence the number increases with every clip.) I got all of it to work except the unique number: this is what I have tried:
    set btn9 to 25
    set btnC to 8
    set ENTER to 76
    set btnE to 14
    set btnV to 9
    set btnDASH to 27
    set btnX to 7
    set btnNEXT to 125

    tell application “Final Cut Pro”
    activate
    tell application “System Events”
    delay 0.2
    key code btnNEXT #move forward
    delay 0.2
    key code btnNEXT #move forward
    delay 0.2
    key code btnX #mark clip
    delay 0.2
    key code btn9 using {command down} #get info
    delay 0.2
    key code btnC using {command down} #copy clip name
    delay 0.2
    key code ENTER #close info window
    delay 0.3
    key code btnE using {command down} #export dialogue
    delay 0.3
    key code btnV using {command down} #paste name
    delay 0.3
    tell application “Finder”
    activate
    set the clipboard to number of files in folder (“Users/70s/Desktop/102ORT”)
    delay 0.3

    tell application “Final Cut Pro”
    activate
    tell application “System Events”
    delay 0.2
    keystroke “_”
    delay 0.2
    the clipboard
    end tell
    end tell
    end tell
    end tell
    end tell

    it runs fine but doesn’t give me the number after the dash –

    Any help?

    Tangier Clarke replied 3 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Jj Johnson

    September 30, 2016 at 12:22 pm

    Never mind I figured it out!

  • Tangier Clarke

    November 11, 2020 at 12:35 pm

    JJ Johnson, I have been trying to figure out to what extent FCP X is controllable using AppleScript. I got a timeline full of compound clips that I want to replace with their synced clips. I have the synced clip equivalent in the browser. I am doing it manually right now. It would be great if I could use a macro or script to help automate the process. Is this possible?

    My manual process is:

    Select the next compound clip on the timeline (which puts me at the first frame)

    Go the first frame of that clip

    Get the source timecode of that clip

    Find the same name of the that compound clip in the browser, but as a synced clip

    Go to same timecode in the clip as above

    Set the in point

    Replace from start (option + R)

    I don’t know what’s scriptable in FCP X. I could use your insight. A lot of times I do this in clip groups meaning – if there’s a scene/take 8F.1, I work on every instance of that clip first in the timeline so that I stay with that clip in the browser. This way I am not searching constantly in the browser for the next synced clip named the same as the compound clip in the timeline which (being an edit) could happen non-sequentially; like 8F.2,3T.6, 1.4…etc.

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