Re: Launching Terminal example
Re: Launching Terminal example
- Subject: Re: Launching Terminal example
- From: Matthew Harrison <email@hidden>
- Date: Mon, 17 Jun 2002 10:27:27 +0100
- Organization: Beaufort International Group Plc
You win the prize. I tried NSWorkspace, but with no joy.
I found a useful Q&A on running AppleScript the Carbon OSA API:
http://developer.apple.com/qa/qa2001/qa1026.html
and the AppleScript to launch my binary was something like:
sprintf(cmdbuffer,
"tell application \"Terminal\"\n "
" activate\n"
" do script with command \"%s %s %d\"\n"
" set custom title of window 0 to \"%s Console\"\n"
"end tell\n",
consoleProg, hostname, ServerPort,
MYAPPVER);
cheers,
Matthew Harrison
Aaron Kelley wrote:
Hi all,
I'm trying to launch the Terminal from within Cocoa, running a cmndline
program,
much like system("xterm -T \"My Program\" -e <prog>") on unix
I've successfully used NSTask to launch a "script.command" file, but that
just uses the cocoa-app's stdio.
I've also tried /Applications/Utilities/.../Terminal with a .term
file, but
I get 2 Terminal windows, one with the default shell, and the other
with the
shell specified in the .term file.
I'm sure there was a piece of sample code on the ADC which did this,
but I
can't find it now...
any ideas?
You may want to consider using applescript to do this.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.