Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
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 '12 at 8:13

3 Answers 3

up vote 1 down vote accepted

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"
share|improve this answer

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'
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.