Page 1 of 1

Window loses focus when printing as sheet

Posted: Fri Mar 07, 2014 1:12 pm
by tellboy
When using the following:

Code: Select all

on printChart
  answer page setup as sheet
  if the result = "cancel" then
     exit printChart
  end if
  answer printer as sheet
  if the result = "cancel" then
     exit printChart
  end if
  print card from topLeft of me to bottomRight of me into tPrintRect
end printChart
After the script has finished the window to which the sheets are attached does not have the focus.

This does not seem correct.

Does anyone know?

Mac 10.9.2

Thanks

Terry

Re: Window loses focus when printing as sheet

Posted: Fri Mar 07, 2014 5:55 pm
by Klaus
Hi Terry,

please always provide the version of LC you are currently using, thanks.


Best

Klaus

Re: Window loses focus when printing as sheet

Posted: Fri Mar 07, 2014 7:33 pm
by tellboy
Klaus wrote:please always provide the version of LC you are currently using, thanks.
LC 6.5.2 Community

Re: Window loses focus when printing as sheet

Posted: Sat Mar 08, 2014 3:48 am
by PBH
Terry,

The script works for me on Mac OSX 10.8.5 with LC 6.5.2

Have you tried stepping through your script with the debugger using breakpoints to see where it loses focus?

Paul

Re: Window loses focus when printing as sheet

Posted: Sat Mar 08, 2014 9:22 am
by tellboy
It might be LC interacting with 10.9.2.

I have built a standalone app as I thought it might be the IDE but it still does it in the standalone.

If I place open wd "myWindow" in the script that does resolve the issue because open wd clearly brings the parent window to the front in the pecking order.

Is there another way to achieve the same as open wd which does seem rather brutal?


All the best

Terry