Groups | Search | Server Info | Login | Register


Groups > comp.databases.filemaker > #428

Re: Change printer in script

From cortical <cb@corticaldata.com.au>
Newsgroups comp.databases.filemaker
Subject Re: Change printer in script
Date 2011-10-11 10:10 +1030
Organization Aioe.org NNTP Server
Message-ID <j6vvq5$vqa$1@speranza.aioe.org> (permalink)
References <1k8omf1.1pu5lcm1ivty0wN%clkaufmann@gmx.ch>

Show all headers | View raw


On 6/10/11 5:09 AM, Christoph Kaufmann wrote:
> FMP 10 and FMS 10 running on some Windows/Citrix system: I'd like to set
> paper size and page direction without setting a specific printer, the
> user's default printer is just fine.
>
> It seems I need the setup printer script step which will always set a
> printer.
>
> I surrendered and put codes for the printers into the user table. Tried
> to set the printer with scripts (one script per printer). Turned out
> that doesn't work - setting the print setup script step does actually
> set up the printer for the file and changes all the other print setup
> script steps in the file.
>
> Solutions? Recommended plugins?
>

To avoid the last mentioned
<<changes all the other print setup script steps in the file.>>
reset setup and printer to the default at the end of each script; or use 
a single called subscript to centralize all printing ( much easier to 
manage once integrated).



I use a single subscript for printing and 3 script parameters
( and a separate subscript for label printing)
SP example :  radiology|portrait|current

this sturcture works for different deartments on teh same LAN ( and 
hence defualt local printers), and the first SP controls different trays 
on a given printer.


The fly(s) in the ointment can be the print queues; set them from FM 
logged in to the LAN. The other aspect is the IT setup of the print 
queues ( which turned out to be the source of initial problems - i.e 
complete failure to work)

In FM, reset to the default as last step; to avoid issues with any print 
steps in scripts not yet using the subscript.

Sequences include a conditional ( # If [ (Get ( AccountName ) = "****" 
)) for admin/dev to halt the script at the print page for testing purposes


Works across several departments, 20-30 workstations, 3 P'sets and 20+ 
accounts




CONTROL VARIABLES
#SP format: fn | [P, L] | [current, all]
Set Variable [ $_fn; Value:getSP_n ( 1 ) ]
Set Variable [ $_q; Value:getSP_n ( 2 ) ]
Set Variable [ $_n; Value:getSP_n ( 3 ) ]
#
#
#
Show/Hide Status Area
[ Hide ] Adjust Window
[ Resize to Fit ]
#
Set Error Capture [ On ]
#DEFAULT = PORTRAIT
#PAGE SETUP = ANY PRINTER - A4 - PORTRAIT
If [ $_q = "L" ]
#LANDSCAPE
Print Setup [ Orientation: Landscape; Paper size: 8.26" x 11.69" 
][Restore; No dialog ]
Else
#PORTRAIT
Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ 
Restore; No dialog ]
End If
#
Enter Preview Mode
Adjust Window
[ Resize to Fit ]
Enter Preview Mode
#
# #====================================================
#TRAY
#====================================================
#PRINT ANY PRINTER, CURRENT RECORD ONLY
If [ $_fn = "biochemistry" ]
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper 
size: 8.26" x 11.69" ] [ Restore: RICOH Aficio SP 4210N [0EE6A8] ]

#PAPER FEED = TRAY 2
Else If [ $_fn = "radiology" ]
#PAPER FEED = TRAY 1
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper 
size: 8.5" x 11" ] [ Restore: RICOH Aficio SP 4210N [0EE6A8] ]
// Else
End If
#
#
#====================================================
#PAGE SETUP
#====================================================
#DEFAULT = PORTRAIT
#PAGE SETUP = ANY PRINTER - A4 - PORTRAIT
If [ $_q = "L" ]
#LANDSCAPE
Print Setup [ Orientation: Landscape; Paper size: 8.26" x 11.69" ] [ 
Restore; No dialog ]
Else If [ $_q = "p" ]
#PORTRAIT
Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ 
Restore; No dialog ]
Else
#PORTRAIT
Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ] [ 
Restore; No dialog ]
End If
#
#
# If [ (Get ( AccountName ) = "****" ) and ( Get ( ActiveModifierKeys ) 
= 8) ]
Halt Script
End If
#

#====================================================
#PRINT (RECORDS)
#====================================================
#ALL OTHER PRINTING
If [ $_n = "rbb" ]
#RECORDS BEING BROWSED
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper 
size: 8.26" x 11.69" ] [ Restore: ###.###.#.## ]
Else If [ $_n = "current" ]
#CURRENT RECORD
Print [ Current record; All Pages; Orientation: Portrait; Paper size: 
8.26" x 11.69" ] [ Restore: ###.###.#.## ]
Else
#CURRENT RECORD
Print [ Current record; All Pages; Orientation: Portrait; Paper size: 
8.26" x 11.69" ] [ Restore: ###.###.#.## ]
End If

#
#
#
#TRAP FOR USER CANCEL
If[Get(LastError) =1]
Close Window [ Name: $_window_name; Current file ]
End If
#
#
# #Reset page setup = ANY PRINTER - A4 - PORTRAIT - NO DIALOGUE
Print Setup [ Orientation: Portrait; Paper size: 8.26" x 11.69" ]
[ Restore; No dialog ]
Enter Browse Mode



Chris

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Find similar


Thread

Change printer in script clkaufmann@gmx.ch (Christoph Kaufmann) - 2011-10-05 20:39 +0200
  Re: Change printer in script yourname@yourisp.com (Your Name) - 2011-10-07 13:13 +1300
    Re: Change printer in script clkaufmann@gmx.ch (Christoph Kaufmann) - 2011-10-12 18:40 +0200
  Re: Change printer in script cortical <cb@corticaldata.com.au> - 2011-10-11 10:10 +1030

csiph-web