2

I have a set up for live shows using Ableton and Reason. I typically open the Ableton file, wait until it loads and then open Reason. The reason for this is because Reason acts as a slave to Ableton, so Ableton must finish loading before Reason starts.

I tried this (with single and double ampersands), but it wants to open both of them at the same time.

open "~/first_file.als" & open "~/second_file.rns"

If this can be done with AppleScript instead, I'd be willing to do that. I'm using Alfred to run the command.

Thanks!

1
  • 1
    The principal problem is that you can't tell when an application has finished loading a file. The open command is non-blocking and just fires away. The -W switch will make it block until the application is quit again. I can only think of manual sleep timers here.
    – slhck
    Apr 12, 2012 at 8:13

3 Answers 3

2

try letting your command sleep for a few seconds (or however long it takes ableton to load)

i.e...

#!/bin/bash

open "~/first_file.als" 
sleep 10
open "~/second_file.rns"
2

You could use AppleScript — its open commands block the script until an application has finished opening a file.

osascript -e 'tell app "Live"
open POSIX file ((system attribute "HOME") & "/Audio/Template Project/Template.als")
end
tell app "Finder" -- open in the default application
open POSIX file "/Library/Desktop Pictures/Beach.jpg" as alias
end'
0

You can achieve this with one line.

open "~/first_file.als" ; sleep 5 ;  open "~/second_file.rns"

NOTE: Adjust the sleep time as needed.

Unfortunately a sleep may indeed be necessary depending on what you are truly wanting to achieve.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .