Page 2 of 2

Re: Lower third Text scrolling

Posted: Sat Oct 14, 2017 2:39 pm
by Klaus
@proloy

OK, if you are using LC <= 7 then this should do:

Code: Select all

on mouseUp
   repeat with x = 1 to number of buttons of grp "Checkboxes"
      if the hilite of btn x of grp "Checkboxes" then
         put the label of btn x of grp "Checkboxes" & cr after mylist
         
         ## Sure you don't mean something like this:
         ## put line x of fld "News" & CR after mylist
         ## ??? Since you mentioned "editing text".
      end if
   end repeat
   set the text of fld "Lower" to mylist
end mouseUp
Best

Klaus

P.S.
You mentioned an attachment, but there is none.

Re: Lower third Text scrolling

Posted: Mon Oct 16, 2017 5:23 am
by proloy
Dear klaus,
I can't attach file without jpg format. plz download form below.
https://www.dropbox.com/s/l9p6ogboaw6bn ... ecode?dl=0

I am using LC v 8.1.6

Thanks

Re: Lower third Text scrolling

Posted: Mon Oct 16, 2017 12:01 pm
by Klaus
Hi proloy,

you need to ZIP the stack(s) before uploading here!

Ich checked your stack, you have grouped some buttons and added a script to the group.
BUT thsi script will never be executed because:
1. You did not add a "trigger", "mouseup" in this case:

Code: Select all

repeat with x = 1 to number of buttons of grp "Checkboxes"
   if the hilite of btn x of grp "Checkboxes" then
      put the short name of btn x of grp "Checkboxes" & cr after myList
   end if
end repeat
put myList into fld Lower
## QUOTES missing here! -> fld "Lower"
2. The buttons in that group DO however have a "mouseup" script, which will get executed
but NOT the script of the group.

Hint:
A clever naming scheme is half the rent!
So since you want to get a line in a field with a click on the corresponding button,
you should do something like this:
a. Name ALL of your buttons with a SPACE:
Check 1
Check 2
etc...
b. Remove the "mouseup" script from every button!
C. Now you can group ALL of your buttons andf add a mouseup script to the group with this script:

Code: Select all

on mouseup
   put the short name of the target into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
   ## Now do something with -> line tLineNumber of fld "News"
   put CR & line tLineNumber of fld "News" after fld ""Lower"
end mouseup
Best

Klaus

Re: Lower third Text scrolling

Posted: Mon Oct 16, 2017 12:42 pm
by Da_Elf
how are you exporting your text to the tv? ive worked with a software for that. i used livecode as only the GUI that talks to the other software via tcp/ip

Re: Lower third Text scrolling

Posted: Tue Oct 17, 2017 3:44 am
by proloy
Da_Elf wrote:
Mon Oct 16, 2017 12:42 pm
how are you exporting your text to the tv? ive worked with a software for that. i used livecode as only the GUI that talks to the other software via tcp/ip
Hello Da_Elf,
Same here, are you talking about CasparCG?

Re: Lower third Text scrolling

Posted: Tue Oct 17, 2017 4:48 am
by proloy
HI Klaus,
Thanks for reply, i think we are very close to the point.
1. I was forgot to add "mouseUP"
2. Rename all check button.
b. Removed all script from check button.
c. confused

Code: Select all

on mouseup
   put the short name of the target into tClickedButton ---which will be my target?
   ## Extract line number from clicked button name! --- is it "check"?
   put word 2 of tClickedButton into tTargetLineNumber
   ## Now do something with -> line tLineNumber of fld "News" --- what to do?
   put CR & line tLineNumber of fld "News" after fld ""Lower"
end mouseup
I know you may angry on me :cry: but i am learning..
plz consider me and advice..

Thanks.

Re: Lower third Text scrolling

Posted: Tue Oct 17, 2017 5:06 am
by bogs
proloy wrote:
Tue Oct 17, 2017 4:48 am
...I know you may angry on me...
Klaus ? The man has the patience of a saint
Image
Think I'll start calling him 'SinterKlaus', distributing Lc goodies to girls and boys... :mrgreen:

Re: Lower third Text scrolling

Posted: Tue Oct 17, 2017 10:50 am
by Da_Elf
proloy wrote:
Tue Oct 17, 2017 3:44 am
Hello Da_Elf,
Same here, are you talking about CasparCG?
Indeed i am. Awesome program

Re: Lower third Text scrolling

Posted: Tue Oct 17, 2017 11:16 am
by Klaus
Hi proloy,

my fault, sorry!

Code: Select all

on mouseup
   put the short name of the target into tClickedButton ---which will be my target?
   ## Extract line number from clicked button name! --- is it "check"?
   put word 2 of tClickedButton into tTargetLineNumber
   ## put CR & line tLineNumber of fld "News" after fld ""Lower"
   put CR & line tTargetLineNumber of fld "News" after fld "Lower"
end mouseup
See the difference?


Best

Klaus

Re: Lower third Text scrolling

Posted: Wed Oct 18, 2017 4:43 am
by proloy
Klaus wrote:
Tue Oct 17, 2017 11:16 am

Code: Select all

on mouseup
   put the short name of the target into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
 end mouseup
Klaus
really i am not clear,
which will be my target: "fld_News", "checkbox_Check", "fld_Lower" or button?
how can i Extract line number? is it:

Code: Select all

put line 1 of field "News" into button "Check 1"
plz advice..
Thanks

Re: Lower third Text scrolling

Posted: Wed Oct 18, 2017 1:02 pm
by Klaus
Hi proloy,
proloy wrote:
Wed Oct 18, 2017 4:43 am

Code: Select all

on mouseup
   put the short name of the target into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
 end mouseup
you forgot the last and most important line of my script!

Code: Select all

...
 put CR & line tTargetLineNumber of fld "News" after fld "Lower"
end mouseup
Which should explain pretty well what I am doing here.

This is the script of the GROUP of checkboxes.
the short name of the target
-> Will return the name of the clicked CHECKBOX inside of the group like:
-> Check 2

SO "word 1" of this = Check
"word 2" of this = 2

So now we know the corresponding line number of field "News" that is "related" to that checkbox
and we can take that line from field "News" and do whatever we want to do with it.

Hint: You should really go through these stacks to get the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

Re: Lower third Text scrolling

Posted: Wed Oct 18, 2017 2:59 pm
by bogs
Klaus wrote:
Wed Oct 18, 2017 1:02 pm
Hint: You should really go through these stacks to get the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Those are very helpful to read, you *may* also find the "Concepts & Techniques" and "Reference" sections of this stack of help to you to become better aquainted with Lc, it has a pretty good basic examples page and things listed in sections.

Re: Lower third Text scrolling

Posted: Sun Oct 22, 2017 6:01 am
by proloy

Code: Select all

on mouseup
   put the button "Check 1" into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
   ## put CR & line tLineNumber of fld "News" after fld ""Lower"
   put CR & line tTargetLineNumber of fld "News" after fld "Lower"
end mouseup
no luck

Re: Lower third Text scrolling

Posted: Sun Oct 22, 2017 11:19 am
by jmburnod
Hi proloy,

Code: Select all

...
put the button "Check 1" into tClickedButton
...
return empty without error.
Please, try this as Klaus said:

Code: Select all

...
put the short name of the target into tClickedButton
...
Of course your btn name must have two words and last word must be an integer
Best regards
Jean-Marc