From: Rodney S. <rsp...@mc...> - 2006-12-13 15:12:07
|
Kenneth Benoit wrote: > OK - the plot thickens... > > open Applications/CrossOver/WinBUGS14.app /par script.txt > > does *not* work because Apple did not program its magical "open" > command (which is designed to be the command-line equivalent of > double-clicking an icon) to allow command-line arguments following the > name of the program. > > There is an open-x11 equivalent for opening X11 apps, and the lack of > a command line seems to have made this almost unusable for many > people. I found therefore that someone had written a version which > allowed arguments: > > http://xanana.ucsc.edu/Library/init/zsh/man/html/open-x11.html > > but I could not find any equivalent for the plain "open". > > A workaround would be to hard-wire the excecution of script.txt into > WinBUGS14.app itself, either through Mac OS/X or something in WinBUGS... > > Ken Hi Gang: I don't see an obvious solution. First of all, if you want to run a script in OpenBUGS, then the command is: open bugs.exe What happens here is, LaunchServices looks at the file and determines which application is necessary to run it; in this case DarWINE. But, you still run into the problem that no command line arguments are allowed. Also, open-x11 doesn't actually do anything. open-x11 is a part of OS X and this ZSH variant just works around some bugs. But, basically, X11 applications are already built with a command line interface to begin with, so there isn't any magic super-glue necessary. The main guts of the function are towards the end: "$@" & The problem that we are seeing is a little bit different. Mac applications were never launched from the command-line because the Mac never had a command line. So, all open does is launch the application. But, some applications, R for example, can be launched from the command-line with arguments. I took a quick look at the R script that manages this, but I couldn't figure out how it does it. I'm guessing that when it was ported from Linux it had all the necessary command-line stuff so the transition was easy. Perhaps this is a question for the DarWINE or R-SIG-Mac lists as we are all clueless. Rodney |