Writing AppleScript to simultaneously engage recording.

Discussion in 'Mac Programming' started by Apocrathia, Dec 24, 2009.

  1. Apocrathia macrumors 6502

    Joined:
    Jan 6, 2009
    Location:
    University of South Alabama
    #1
    Okay, so I'm wanting to start doing some youtube videos, and in order to reduce desynchronization between audio and video, I want to write a script which will just press them both at the same time. I just want something like this:
    Code:
    tell application "iMovie" to record
    tell application "GarageBand" to record
    
    very very simple script, i just don't know the exact syntax to perform this. can anybody here help?

    Yes, i am using ilife at the moment, i do have access to final cut and logic, but i am wanting to start off stupid and master the simple programs before i move onto more beastly apps.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    From ScriptEditor you can open up Dictionaries for each application. The Dictionary will tell you what commands you can call directly.
     
  3. Apocrathia thread starter macrumors 6502

    Joined:
    Jan 6, 2009
    Location:
    University of South Alabama
    #3
    Thanks, I didn't know about that. I looked through though and I didn't see a specific action for 'record'. I found the boolean return function for seeing if the track is armed for recording, but not a function to actually start the recording. Am I missing something here?
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    The Dictionary for GarageBand does look a little sparse. I don't even see a Record option in the menus of the program, it's only accessible on the GUI. That makes it hard to do from AppleScript. I've used AppleScript some, but not for interacting with the interface like this. You may be able to find some tutorials online.
     
  5. Apocrathia thread starter macrumors 6502

    Joined:
    Jan 6, 2009
    Location:
    University of South Alabama
    #5
    I wonder if I could call to system events and send a keystroke to the program, because I think you can just hit 'r' for it to start recording.

    I ended up just recording video and audio off sync and syncing them later in iMovie. Which I think this might be the one and only time I use that program. I really am not fond of it thus far. The cross-compatibility between it and GarageBand is nowhere near as good as I was expecting. I will probably use Logic/Final Cut for the next video I use. I am pretty damn sure that AppleScript API calls for just about anything exist for those two apps. Unless the devs were drunk when they we're coding the API.

    I really appreciate the dictionary advice, I will be using that a LOT more in the future. I just started learning AppleScript today, I'm sure I can get a good bit of use out of it.

    Edit: I can't pull the dictionaries for Final Cut or Logic within the AppleScript Editor. Any suggestions? There's gotta be an API somewhere in there.
     

Share This Page