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 wish to use mp3blaster (installed through MacPorts) via Finder. I want to double-click an mp3 file and get it opened in mp3blaster. But I haven't been able to do so. I created an app and, in another try, a service in Automator, using the following script:

/opt/local/bin/mp3blaster $1

Any ideas?

share|improve this question

4 Answers 4

You should be able to get info on your .mp3 file and change the associated app.

Go to cmd-i of your app, click the drop-down of "Open with:" .. Select other and navigate to your directory. You will have to select Enable : All Applications to be able to click on the mp3blaster app.

share|improve this answer
    
The problem is that mp3blaster is not an app but a bin. So I cannot do what you suggest. –  NVaughan Nov 19 '12 at 22:49
    
I think you might have to create an apple script and then have the files associated to the apple script. –  Mark Cohen Nov 20 '12 at 0:17
    
Thanks. I tried to, unsuccessfully. Could you please tip me on that? –  NVaughan Nov 20 '12 at 15:08

Start Automator, create a workflow with a Run AppleScript action and save it as an application.

enter image description here

Then select any mp3 file, type Cmd-I and change the default application to the application saved before.

share|improve this answer
    
Thanks, @patrix. But it doesn't work. Same error message. (Of course, if I run /opt/local/bin/mp3blaster from a bash shell it works.) –  NVaughan Nov 20 '12 at 19:30
    
What happens if you run it inside Automator and look at "Results" afterwards? –  patrix Nov 20 '12 at 21:45
    
See here: i49.tinypic.com/2rxgmf6.jpg –  NVaughan Nov 20 '12 at 22:23
    
Ah, of course, you can't run interactive commands with a "Run Shell Script" action. –  patrix Nov 21 '12 at 5:05

Use $@ to refer to a file being passed to a shell script in Automator:

/opt/local/bin/mp3blaster $@

or

/opt/local/bin/mp3blaster "$@"
share|improve this answer
    
I get the error, "The action “Run Shell Script” encountered an error." –  NVaughan Nov 20 '12 at 15:47

Finally managed how to do it using AppleScript instead of bash. (I followed this example: Firing up Terminal from an Automator Workflow?)

on run {input, parameters}
    tell application "Terminal"
        activate
        if (the (count of the window) = 0) or ¬
            (the busy of window 1 = true) then
            tell application "System Events"
                keystroke "n" using command down
            end tell
        end if
        do script "/opt/local/bin/mp3blaster \"" & (POSIX path of ¬
            (input as string)) & "\"" in window 1
    end tell
    return input
end run
share|improve this answer
    
However, this only works for single files taken as input. How could I alter the script to parse multiple files? –  NVaughan Nov 22 '12 at 2:18

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.