Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've got a tool to normalize WAV audio files, but it only works by dragging and dropping the file either onto the GUI or onto its dock's icon.

As far as I know the app doesn't have any option to pass from command line, so I was wondering whether there is a way to pass the file from a terminal in order to use it in a bash script.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Generally this is equivalent to dragging a file onto an app's icon:

open -a Your_WAV_Tool.app /path_to/your_file.wav

You can use the complete path to your app if it isn't in an expected place.

share|improve this answer
    
wow! thanks, it worked like a charm –  rraallvv Jan 10 '13 at 21:36

I can't answer for certain, but it sounds like a no. Unless the app reads command line arguments, you can't pass it the file. And I don't think you can't trigger GUI events without a GUI.

The best solution I can think of is using something like Automator to try and simulate the drag and drop. But a quick look through Automator doesn't seem to show anything event simulation.

So the last option is writing your own program to literally drag and drop a file. You can then write a command line interface for your program. This can be achieved with Java's Robot class.

share|improve this answer
    
I'm not sure how attached you are to your conversion app, but you can definitely use other command line conversion tools. See this question: apple.stackexchange.com/questions/26099/… –  styfle Dec 18 '12 at 21:26
    
please see this question, Levelator only comes in GUI App –  rraallvv Dec 25 '12 at 23:13
    
@rraallvv I would download the linux version since it is written in Python and just call the function directly instead of using the wxPython bindings. I'm assuming the only thing preventing the linux version from running on OS X is the GUI. –  styfle Dec 26 '12 at 19:55
    
hmmm... I'll give it a try, thanks –  rraallvv Dec 26 '12 at 20:31

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.