Print without dialogs.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
oldummy
Posts: 78
Joined: Mon Jun 13, 2016 3:21 pm

Print without dialogs.

Post by oldummy » Sun Jan 14, 2024 6:14 pm

I am trying to remake a stack I once made.
It involves printing from a tvar with 4 lines, one name on each line.
It works well enough but. I have to go through 3 dialog windows for each one.
I feel certain I didn't have to suffer through that on the original stack
The original stack and scripts are years gone.
Can I just set things such that I just click the "Print" button on the stack and wait for the task to finish?

I'm not sure that the script is useful to answer this question, but I am enclosing the repeat loop I am using.
Again, it prints as it should, it's just that I have to babysit it. I may have up to fifty such letters to print.

Code: Select all

repeat for each line theline in tupdate --tupdate contains 4 lines with a name on each line
    put theline & cr & Lmyletter into fld "blah"of cd 1 --myletter is a local var
    revprinttext fld "blah" of cd 1
    put "" into fld "blah"of cd 1
end repeat

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Print without dialogs.

Post by richmond62 » Sun Jan 14, 2024 7:08 pm

What's a "tvar"?

And are you intending to print each line on a separate sheet of paper?

Because with your script that is what happens:
-
Screenshot 2024-01-14 at 20.24.10.png
-

Code: Select all

on mouseup
   put fld "fINFO" into tupdate
   repeat for each line theline in tupdate 
      put theline & cr into fld "blah"of card id 1002 
      revprinttext fld "blah" of card id 1002
      put " " into fld "blah"of card id 1002
   end repeat
end mouseup

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Print without dialogs.

Post by richmond62 » Sun Jan 14, 2024 7:30 pm

If you want the print dialogues NOT to show up you need to write this:

revShowPrintDialog false, false

before your print command.

Code: Select all

on mouseup
   put fld "fINFO" into tupdate
   repeat for each line theline in tupdate 
      put theline & cr into fld "blah"of card id 1002 
      revShowPrintDialog false, false
      revprinttext fld "blah" of card id 1002
      put " " into fld "blah"of card id 1002
   end repeat
end mouseup

oldummy
Posts: 78
Joined: Mon Jun 13, 2016 3:21 pm

Re: Print without dialogs.

Post by oldummy » Sun Jan 14, 2024 7:54 pm

That is exactly what I am trying to do.One name at the beginning of each page. 4 names,4 pages.
And your script worked great. Thank you! I read the dictionary ab page. 4 names,4 pages.
And your script worked great. Thank you! Big relief here.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Print without dialogs.

Post by richmond62 » Sun Jan 14, 2024 7:58 pm

Super!

Love, Richmond.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”