Page 1 of 1

Print card fails first time then works usually

Posted: Mon Jul 14, 2014 4:27 pm
by martyWell
Hi! I"m working on a Mac OS app. I read a student's test results from a database and put them into a field on a card. I go invisibly to the cd, then issue a print this card command. The first time I issue the print card command, nothing happens. If I repeat the command, it usually works.

I've tried putting in a confirmation answer step -- which is after the move to the invisible card. Same results. So, for now, I go to the card, show a button and message telling the student to manually print the results if it doesn't work. Then, I issue the print card command. If I do it the other way around, the rest of the code doesn't execute.

I have experimented with

open printing
close printing

This works, but prints a blank page each time, which I don't want.

I'm not new to this kind of programming, but relatively new to Livecode. (Years with ToolBook.)

I should say that I've tested this both in standalone and development. From 2 different Macs (both running Mac OS 10.9.3). This is Livecode 6.6.2. Different printers, too. One network; one USB. No difference.


Any ideas greatly appreciated!

Re: Print card fails first time then works usually

Posted: Mon Jul 14, 2014 6:59 pm
by jmburnod
Hi martyWell,

You have to use a print cd message like this

Code: Select all

open printing 
print this cd
close printing
And it should work
Best regards
Jean-Marc

Re: Print card fails first time then works usually

Posted: Tue Jul 15, 2014 2:14 pm
by martyWell
Jean-Marc,

Thanks for the quick reply. I tried enclosing the print this cd within the open/close printing. It didn't help.

If I create a new main stack I can print fine -- even without the open/close printing.

I don't know what there is about my stacks that are causing the problem. I have had some crashing issues and at one point I had to save them back to 6.6.2 format.

LiveCode doesn't have any utility to copy everything to a new stack does it?

Marty Weller

Re: Print card fails first time then works usually

Posted: Tue Jul 15, 2014 3:57 pm
by jmburnod
Hi Marty,

You can try to save the stack in legacy format and you could open it with a previous version of LiveCode.
Best
Jean-Marc

Re: Print card fails first time then works usually

Posted: Fri Jul 18, 2014 9:52 am
by MaxV
You can use this script: http://livecodeshare.runrev.com/stack/5 ... eporter-LC
to recover all your code and copy it in the new script.