Thanks to everyone for helping !!!
Using setEnvironment made it easily. I was looking for a complicated solution
when the solution was not so difficult.
Le 14 avr. 2014 à 17:59, Colas a écrit :
> Thanks also for the idea of -setEnvironment. I will try.
Unfortunately, it is not working. Gnuplot is complaining.
! Package pgfplots Error: Sorry, the gnuplot-result file ‘myFile.pgf-plot.t
able' could not be found. Maybe you need to enable the shell-escape feature? Fo
r pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnuplo
t .g
Bryan,
I am trying to adapt your code to pdflatex. I hope it will work!!!
It seems that putting the option -l at the end was very important.
Do you know why? I have to admit that I put these « -c » and « -l » options
thanks to other answers, but I don’t know what they are doing.
Thanks very muc
Le 14 avr. 2014 à 17:07, Bryan Vines a écrit :
> Hi Colas,
>
> Pico is an interactive text editor. I don’t think NSTask is going to give you
> much opportunity to interact with it. Are you using Pico as an example, or
> are you actually trying to launch Pico?
>
> If you really *are* trying t
Colas,
If my previous code snippet doesn’t work with pdflatex, NSTask has a
-setEnvironment method; it may allow you to set your task’s environment
variables.
—
Bryan Vines
On Apr 14, 2014, at 10:40 AM, Colas wrote:
> My problem is that I want to launch pdflatex with the -shell-escape optio
Colas,
Bash’s -c option expects commands in a string which follows. Therefore, this
will work: I’m using /usr/bin/touch as an example, rather than your example of
pico, which is an interactive text editor.
NSTask * myTask = [[NSTask alloc]init];
NSArray * arguments = @[@"-c", @"/us
> Try putting
>
> /usr/bin/pico /Users/colas/myfile.txt
>
> into separate items in the argument NSArray. I find the man page ambiguous,
> and I lack direct experience, but that may be what bash expects.
>
>
It is not working, unfortunately.
> I can’t guarantee that this will solve the large
On Apr 14, 2014, at 10:08 AM, Colas B wrote:
> Without the quotes, the error is
> Error opening terminal: unknown.
Terminal doesn't just run the shell (which, in turn, runs pico). It provides a
window and a TTY (terminal device) for the processes to use and translates the
I/O to the window. T
On 14 Apr 2014, at 10:08 AM, Colas B wrote:
> OK.
>
> But without the simple quotes, it also fails.
>
> With the quotes, the error is
> /bin/bash: pico /Users/colas/myfile.txt: No such file or directory
> Without the quotes, the error is
> Error opening terminal: unknown.
>
> Thanks!
> Le Lund
OK.
But without the simple quotes, it also fails.
With the quotes, the error is
/bin/bash: pico /Users/colas/myfile.txt: No such file or directory
Without the quotes, the error is
Error opening terminal: unknown.
Thanks!
Le Lundi 14 avril 2014 16h19, Jerry Krinock a écrit :
From documentation
Colas,
Do you want your app to open a Terminal window, in which Pico has opened the
file at /Users/colas/myfile.txt?
If that’s so, I don’t think launching it via NSTask is going to get you
anything.
What is the end result you want to achieve?
—
Bryan Vines
On Apr 14, 2014, at 8:59 AM, Colas B
From documentation of -[NSTask setArguments:] :
"The strings in arguments do not undergo shell expansion, so you do not need to
do special quoting”
I don’t know what they mean by “special”, but anyhow, the ‘ ' you put around
your last argument will be passed to your tool and cause it to fail.
Dear cocoa-dev,
I am would like to launch a binary as if I launched it via terminal. I tried
the following but it is not working.
NSTask * myTask = [[NSTask alloc] init];
NSArray * arguments = @[@"-c", @"-l", @"'/usr/bin/pico
/Users/colas/myfile.txt'"];
[myTask setCurrentDirecto
13 matches
Mail list logo