Simple question

I have a script that I use to launch an application with some options. The question revolves around these two statements

do shell script "/Applications/ -ProfileManager &"


The statement launches Firefox’s profile manager and then after I select a profile Firefox launches. The problem is that the Applescript just sits there running and never executes the “return” to stop.

Any thoughts on this?

Model: Mac Pro
AppleScript: 2.1.2
Browser: Firefox 4.0b7
Operating System: Mac OS X (10.6)

Found the answer after a few minutes of Googling

do shell script "/Applications/ -ProfileManager  > /dev/null 2>&1 &"

A little bit simpler code without backgrounding and piping stderr and stdout of your application.

do shell script "open /Applications/ --args  -ProfileManager"

That is simple.

I just figured out the syntax for the longer version by reviewing the bash documentation. Question,

In the FF documentation they always use this

/Applications/ -ProfileManager

the bash I added after that assigns stdout and stderr to null (as I understand it).

So what exactly does your short form do and why does it not need to point to the firefox-bin?

do shell script “open /Applications/ --args -ProfileManager”

You could also just point me to a reference.


Open will open the and will look for the info.plist file. here it finds the executable in this file (on my machine its firefox-bin) and will launch it just like the finder does. The only advantage is that people with tweaked or other versions of firefox (where the file is named different) your script doesn’t work. I’ve also seen apps with more than one file in MacOS folder then again open will always opens the same version as the finder. I’m also suprised that FF don’t do this in their documentation

What does the



It’s probably not in the documentation because ‘open’ is an OS X specific command that isn’t available on other platforms and the writers may not have been aware of it. It’s basically the same as double-clicking a file in the Finder.

To be quite safe in situations where the user may have put Firefox in a different place, the best way to do it is:
do shell script “open -b org.mozilla.firefox --args -ProfileManager”

–args passes the remaining arguments to Firefox rather than trying to use them as arguments of ‘open’ itself. For more info, check the man page for open.


Thanks gannet, I didn’t know this either.

Regarding man pages. They are easier to read in something like Preview. I created a file called


in the root of my user account. In the file I have this

man -t “${1}” | open -f -a /Applications/

Now when I want to read/find/go back in a man page I simply enter this in the terminal

pman bash

and I have the bash or other info opened in Preview.

Her’s an alternative:

set theResult to text returned of (display dialog "Command to man:" default answer "")
do shell script ("man -t " & (quoted form of theResult) & " | open -f -a /Applications/") 

I like that :slight_smile:

Why doesn’t this work?

man -t ls | open -f -b

Good question, although -f does say “opens the results in the default text editor” so I guess we shouldn’t complain. It’s just odd that -fa works while -fb doesn’t.
Note that -a doesn’t need the full path to the app, you can just put “-a Preview”.