Re: using stdout

2019-12-18 Thread JB via use-livecode
I found that c code.  It is for a server-socket and client-socket.
Two separate programs which we could call from live code
with a shell command and give arguments if needed.

JB


> On Dec 18, 2019, at 12:56 PM, doc hawk via use-livecode 
>  wrote:
> 
> 
> On Dec 18, 2019, at 12:51 PM, JB via use-livecode 
>  wrote:
>> 
>> A year or so ago I was messing around with the terminal in c code
>> and found some code that opens two terminals and they talk to
>> each other.
>> 
>> Is that something I can use to communicate with live code too?
> 
> Conceivably, but you’re going to have to know how to launch Terminal with 
> options (and I haven’t a clue how to do that).
> 
> If you can open them so that they have a known socket, livecode can deal with 
> that.
> 
> Why the interest in Terminal for this?  It’s pretty straightforward to create 
> your own standalone if all you want to do is write to a second application 
> for output.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread doc hawk via use-livecode

On Dec 18, 2019, at 1:24 PM, JB via use-livecode 
 wrote:
> 
> Thank you very much!
> 

You’re quite welcome. 
> I will be playing around with these a lot.
> 

I’m interested to see what you do with it.

Also, at the conference this year, I asked panagiotis, who bounced me to Mark 
on the question (“if *anyone* knows, it would be mark”), who immediately gave 
the answer.

I was interested in the slave not showing up in the dock.  Mark replied that 
there is a simple visibility option in the, o heck, I forget the name, but the 
“dossier” of options/declarations that happens in the build.  So it’s a one 
line edit.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
Thank you very much!

I will be playing around with these a lot.

JB


> On Dec 18, 2019, at 1:20 PM, doc hawk via use-livecode 
>  wrote:
> 
> 
> On Dec 18, 2019, at 1:03 PM, JB via use-livecode 
>  wrote:
>> 
>> Actually as I said in the first post I do not really need it.  I was
>> reading the manual about something else which I have already
>> forgot and I ran across the code so I tried it.
> 
> Investigate “sockets” in the dictionary.
> 
>> 
>> But I am interested in messing around with writing to another
>> application if you have any examples.  Also if you needed
>> the c code let me know and I can probably dig it out for you.
>> 
> 
> I emailed you master and slave, since we can’t attach to the list.
> 
> It’s by no means an example of how to do it; it’s my partway-done experiment 
> from when I wanted a helper application to allow non-blocking database 
> actions.  Switching from mySQL to postgreSQL solved my problem far more 
> cleanly (I don’t know if it’s still the case, but LiveCode could only send a 
> single mySQL transaction at the time, and startup took several hundred 
> sequential commands . . .).  I may use it again someday, but not for now.
> 
> Anyway, it really doesn’t do much more than take something from the input 
> window in one application, encrypt it, and send it across a socket to the 
> other.
> 
> I *want* to say that master launches slave when it starts up, but it’s been a 
> few years.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread doc hawk via use-livecode

On Dec 18, 2019, at 1:03 PM, JB via use-livecode 
 wrote:
> 
> Actually as I said in the first post I do not really need it.  I was
> reading the manual about something else which I have already
> forgot and I ran across the code so I tried it.

Investigate “sockets” in the dictionary.

> 
> But I am interested in messing around with writing to another
> application if you have any examples.  Also if you needed
> the c code let me know and I can probably dig it out for you.
> 

I emailed you master and slave, since we can’t attach to the list.

It’s by no means an example of how to do it; it’s my partway-done experiment 
from when I wanted a helper application to allow non-blocking database actions. 
 Switching from mySQL to postgreSQL solved my problem far more cleanly (I don’t 
know if it’s still the case, but LiveCode could only send a single mySQL 
transaction at the time, and startup took several hundred sequential commands . 
. .).  I may use it again someday, but not for now.

Anyway, it really doesn’t do much more than take something from the input 
window in one application, encrypt it, and send it across a socket to the other.

I *want* to say that master launches slave when it starts up, but it’s been a 
few years.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
Actually as I said in the first post I do not really need it.  I was
reading the manual about something else which I have already
forgot and I ran across the code so I tried it.

But I am interested in messing around with writing to another
application if you have any examples.  Also if you needed
the c code let me know and I can probably dig it out for you.

JB


> On Dec 18, 2019, at 12:56 PM, doc hawk via use-livecode 
>  wrote:
> 
> 
> On Dec 18, 2019, at 12:51 PM, JB via use-livecode 
>  wrote:
>> 
>> A year or so ago I was messing around with the terminal in c code
>> and found some code that opens two terminals and they talk to
>> each other.
>> 
>> Is that something I can use to communicate with live code too?
> 
> Conceivably, but you’re going to have to know how to launch Terminal with 
> options (and I haven’t a clue how to do that).
> 
> If you can open them so that they have a known socket, livecode can deal with 
> that.
> 
> Why the interest in Terminal for this?  It’s pretty straightforward to create 
> your own standalone if all you want to do is write to a second application 
> for output.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread doc hawk via use-livecode

On Dec 18, 2019, at 12:51 PM, JB via use-livecode 
 wrote:
> 
> A year or so ago I was messing around with the terminal in c code
> and found some code that opens two terminals and they talk to
> each other.
> 
> Is that something I can use to communicate with live code too?

Conceivably, but you’re going to have to know how to launch Terminal with 
options (and I haven’t a clue how to do that).

If you can open them so that they have a known socket, livecode can deal with 
that.

Why the interest in Terminal for this?  It’s pretty straightforward to create 
your own standalone if all you want to do is write to a second application for 
output.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
A year or so ago I was messing around with the terminal in c code
and found some code that opens two terminals and they talk to
each other.

Is that something I can use to communicate with live code too?

JB


> On Dec 18, 2019, at 12:47 PM, doc hawk via use-livecode 
>  wrote:
> 
> 
> On Dec 18, 2019, at 12:38 PM, JB via use-livecode 
>  wrote:
>> 
>> open process "/Applications/Utilities/Terminal.app" for write
>> write tMessage && the long time & return to stdout
> 
> *That* is the problem.
> 
> If you open a terminal from within livecode, that doesn’t turn it into 
> stdout, which already existed (even if null).
> 
> 
> In a terminal,
> 
> /Applications/LiveCode\ Business\ 9.5.0.app/Contents/MacOS/LiveCode-Business 
> 
> (Or whatever).
> 
> That terminal will be stdout for livecode, at which you can write to it.
> 
> There might be a way to open a terminal from lived ode to which it could 
> write, but it won’t become stdout.
> 
> If you look through the archives (or maybe it’s on the message board due to 
> attachments), you should be able to find my master/slave pair which open a 
> socket to one another and can talk.  It’s been a few years, though.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread doc hawk via use-livecode

On Dec 18, 2019, at 12:38 PM, JB via use-livecode 
 wrote:
> 
> open process "/Applications/Utilities/Terminal.app" for write
> write tMessage && the long time & return to stdout

*That* is the problem.

If you open a terminal from within livecode, that doesn’t turn it into stdout, 
which already existed (even if null).


In a terminal,

/Applications/LiveCode\ Business\ 9.5.0.app/Contents/MacOS/LiveCode-Business 

(Or whatever).

That terminal will be stdout for livecode, at which you can write to it.

There might be a way to open a terminal from lived ode to which it could write, 
but it won’t become stdout.

If you look through the archives (or maybe it’s on the message board due to 
attachments), you should be able to find my master/slave pair which open a 
socket to one another and can talk.  It’s been a few years, though.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
So I run the following code in live code after
I have opened the terminal app. and from the
message box I enter,

open process "/Applications/Utilities/Terminal.app" for write
write tMessage && the long time & return to stdout

I get nothing.

JB


> On Dec 18, 2019, at 9:24 AM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 12/18/19 7:01 AM, JB via use-livecode wrote:
>> This isn’t something I need but I read in a older manual
>> you can write to the terminal using stdout.  It said the
>> terminal needs to  be open and you use code like
>> below to log or write to the terminal;
>> put "Hello world." into tMessage
>> write tMessage && the long time & return to stdout
>> When I run this code nothing happens even though
>> I have the terminal open.
>> Does anyone know how to use stdout with the terminal
>> from within a stack?
> 
> Works here, on linux at least.
> Launch LC from a commandline, then from the messagebox type
> write "hello, world" to stdout
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
I really don’t use the shell or terminal much.  When you
say it is awkward I suspect I did not do it right.  All I did
was open the terminal and use open with the path and
it opened live code.  Should I have written something
else?  Am I supposed to launch a process?

JB


> On Dec 18, 2019, at 11:25 AM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 12/18/19 9:49 AM, JB via use-livecode wrote:
>> Well I tried it on OS X 10.11 using Livecode 4.6.2
>> and the application launches then I create a new
>> main stack and use the message box to enter
>> your code and nothing happens.
> 
> I don't have anything that old to test with, but it works with OSX 10.14 and 
> LC 9.x. Granted, launching via commandline on OSX is a bit awkward.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread doc hawk via use-livecode

On Dec 18, 2019, at 11:06 AM, Bob Sneidar via use-livecode 
 wrote:
> 
> Well, sudo already offers a mechanism to prevent volatile teminal activity. 

But that’s a privilege restriction about superuser.

Generally, I would think that a process shouldn’t be able to write to a random 
other process, even if owned by the same user.

Unix keeps the tree of which process spawns what.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread Mark Wieder via use-livecode

On 12/18/19 9:49 AM, JB via use-livecode wrote:

Well I tried it on OS X 10.11 using Livecode 4.6.2
and the application launches then I create a new
main stack and use the message box to enter
your code and nothing happens.


I don't have anything that old to test with, but it works with OSX 10.14 
and LC 9.x. Granted, launching via commandline on OSX is a bit awkward.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread Bob Sneidar via use-livecode
Well, sudo already offers a mechanism to prevent volatile teminal activity. 

Bob S


> On Dec 18, 2019, at 11:02 , doc hawk via use-livecode 
>  wrote:
> 
>> I didn’t know you needed to launch it from
>> the command line.
> 
> Without that, I don’t think that livecode could be associated with any 
> particular terminal.
> 
> In fact, I suspect that OSX would block any attempt from any non-descendent  
> application trying to write to a terminal (or at least hope so . . .)

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread doc hawk via use-livecode

On Dec 18, 2019, at 9:36 AM, JB via use-livecode 
 wrote:
> 
> I didn’t know you needed to launch it from
> the command line.

Without that, I don’t think that livecode could be associated with any 
particular terminal.

In fact, I suspect that OSX would block any attempt from any non-descendent  
application trying to write to a terminal (or at least hope so . . .)

And are you you using “open”, or actual using a direct command such as 
/Applications/LiveCode\ Business\ 9.5.0.app/Contents/MacOS/LiveCode-Business ?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
Well I tried it on OS X 10.11 using Livecode 4.6.2
and the application launches then I create a new
main stack and use the message box to enter
your code and nothing happens.

JB


> On Dec 18, 2019, at 9:24 AM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 12/18/19 7:01 AM, JB via use-livecode wrote:
>> This isn’t something I need but I read in a older manual
>> you can write to the terminal using stdout.  It said the
>> terminal needs to  be open and you use code like
>> below to log or write to the terminal;
>> put "Hello world." into tMessage
>> write tMessage && the long time & return to stdout
>> When I run this code nothing happens even though
>> I have the terminal open.
>> Does anyone know how to use stdout with the terminal
>> from within a stack?
> 
> Works here, on linux at least.
> Launch LC from a commandline, then from the messagebox type
> write "hello, world" to stdout
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread JB via use-livecode
I didn’t know you needed to launch it from
the command line.

Thanks,
JB


> On Dec 18, 2019, at 9:24 AM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 12/18/19 7:01 AM, JB via use-livecode wrote:
>> This isn’t something I need but I read in a older manual
>> you can write to the terminal using stdout.  It said the
>> terminal needs to  be open and you use code like
>> below to log or write to the terminal;
>> put "Hello world." into tMessage
>> write tMessage && the long time & return to stdout
>> When I run this code nothing happens even though
>> I have the terminal open.
>> Does anyone know how to use stdout with the terminal
>> from within a stack?
> 
> Works here, on linux at least.
> Launch LC from a commandline, then from the messagebox type
> write "hello, world" to stdout
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: using stdout

2019-12-18 Thread Mark Wieder via use-livecode

On 12/18/19 7:01 AM, JB via use-livecode wrote:

This isn’t something I need but I read in a older manual
you can write to the terminal using stdout.  It said the
terminal needs to  be open and you use code like
below to log or write to the terminal;

put "Hello world." into tMessage
write tMessage && the long time & return to stdout

When I run this code nothing happens even though
I have the terminal open.

Does anyone know how to use stdout with the terminal
from within a stack?


Works here, on linux at least.
Launch LC from a commandline, then from the messagebox type
write "hello, world" to stdout

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


using stdout

2019-12-18 Thread JB via use-livecode
This isn’t something I need but I read in a older manual
you can write to the terminal using stdout.  It said the
terminal needs to  be open and you use code like
below to log or write to the terminal;

put "Hello world." into tMessage
write tMessage && the long time & return to stdout

When I run this code nothing happens even though
I have the terminal open.

Does anyone know how to use stdout with the terminal
from within a stack?

JB


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode