Page 1 of 1

socket programming

Posted: Thu Mar 15, 2012 8:21 pm
by ivaho
I'am trying to write a small program that plays movies files on my server.

On the server in command line I can type in {play 1 amb} and than movie amb is being played

In live code I can create a button. That plays that file.
{write "play 1 amb " & format("\r\n") to socket "localhost:5250"} (thanks Sturgis )

Now I have a small piece of script that puts files from a dir into a scrolling list field.

What i'am now looking for is a way to play the file that is select in my scrolling list field on my server

Should be something like
write "play 1
  • " & format("\r\n") to socket "localhost:5250"

    How to get the tekst from the scrolling list field into that code??

    Kind regards
    Ivo

Re: socket programming

Posted: Thu Mar 15, 2012 9:17 pm
by Klaus
Hi Ivo,

try something like this in the script of that scrolling list field with teh files:

Code: Select all

on mouseup
  put the selectedtext of me into tFile
  put "play 1" && tFile && "format("\r\n") into tSocketString
  write tSocketString to socket "localhost:5250"
end mouseup
Not tested but should work.. (Famous last words :D )


Best

Klaus

Re: socket programming

Posted: Tue Mar 20, 2012 9:56 pm
by ivaho
Thanks,

It worked.

Another question, what if i would like to add some tekst to tFile later on.
tFile contains my selected text and i want to add the word 'twice'

So tFile would than contain the selected movie
Match
And the added word
Twice

Kind regards and many thanks for your help