# Mac shared printer problem

**URL:** <https://forum.servoy.com/t/mac-shared-printer-problem/6770>\
**Category:** Classic Servoy\
**Created:** [November 22, 2006, 7:44pm UTC](https://forum.servoy.com/t/mac-shared-printer-problem/6770 "2006-11-22T19:44:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elyod\_72](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@elyod\_72](https://forum.servoy.com/u/elyod_72)\
**Post date:** [November 22, 2006, 7:44pm UTC](https://forum.servoy.com/t/mac-shared-printer-problem/6770/1 "2006-11-22T19:44:24Z")

</div>

I have a Mac OS X 10.3.9 running a Servoy client. I seem to not be able to switch printers to a shared printer to print a layout. It works on Windows, with a little arm wrestling. I realized that on Windows I had to also provide the host computer. But it doesn’t work the same on the Mac side. I am at a loss. Any help would be greatly appreciated. Here is my code:

```auto
if (utils.stringLeft(os, 1) == 'W')
  {
    forms.job_camera_report_print.controller.setPreferredPrinter("\\\\\win3k\\operators");
    forms.job_camera_report_print.controller.print(true,false);
    forms.job_camera_report_print.controller.print(true,false);
    forms.cr_spec_sheet.controller.setPreferredPrinter("\\\\\win3k\\operators");
    forms.cr_spec_sheet.controller.print(true,false);
    forms.job_camera_report_print.controller.setPreferredPrinter("\\\\\pdc\\io");
    forms.job_camera_report_print.controller.print(true,false);
    forms.job_camera_report_print.controller.print(true,false);

  }
  else if (utils.stringLeft(os, 1) == 'M')
  {
    forms.job_camera_report_print.controller.setPreferredPrinter("operators");
    forms.job_camera_report_print.controller.print(true, false );
    forms.job_camera_report_print.controller.print(true, false );
    forms.cr_spec_sheet.controller.setPreferredPrinter("operators");
    forms.cr_spec_sheet.controller.print(true, false ); 
  }

```

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [November 23, 2006, 10:06am UTC](https://forum.servoy.com/t/mac-shared-printer-problem/6770/2 "2006-11-23T10:06:47Z")

</div>

Jim, I guess this should work.

I am not sure but maybe the tools plugin setDefaultPrinter function can help you.  
It is an osascript (applescript) I use to drive it and as such should be more apple-like.
