Xojo Conferences
MBSOct2019CologneDE

« Celebrating 60 articl… | Home | LLVM Bitcode »

Page Setup Dialog example


We got a new Page Setup Dialog example for you. As the MBS FileMaker Plugin can control the page setup dialog on MacOS, the following example can create serveral PDF files from one layout and switch between landscape and portrait as well as between different paper names.


The example also shows how to use Schedule.EvaluateAfterDelay in a clever way to run menu commands while a script is paused. Today we use menu entry with ID 57606, which is the page setup menu command.

Set Variable [ $r ; Value: MBS( "PageSetupDialog.Install" ) ] 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.Enable" ) ] 

# A4 Portrait

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetPaperName"; "iso-a4" ) ] 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetPaperOrientation"; "portrait" ) ] 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetNoDialog"; 1 ) ] 

Set Variable [ $r ; Value: MBS( "Schedule.EvaluateAfterDelay"; ,1; "MBS( \"Menubar.RunMenuCommand\"; 57606 )") // run Page Setup Dialog in 0.1 seconds  ] 

Pause/Resume Script [ Duration (seconds): 1 ] 

Save Records as PDF [ With dialog: Off ; “test A4.pdf” ; Records being browsed ; Create folders: Off ] 

# A5 Portrait

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetPaperName"; "A5" ) ] 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetNoDialog"; 1 ) ] 

Set Variable [ $r ; Value: MBS( "Schedule.EvaluateAfterDelay"; ,1; "MBS( \"Menubar.RunMenuCommand\"; 57606 )") // run Page Setup Dialog in 0.1 seconds  ] 

Pause/Resume Script [ Duration (seconds): 1 ] 

Save Records as PDF [ With dialog: Off ; “test A5.pdf” ; Records being browsed ; Create folders: Off ] 

# A4 Landscape

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetPaperName"; "iso-a4" ) ] 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetPaperOrientation"; "landscape" ) ] 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.SetNoDialog"; 1 ) ] 

Set Variable [ $r ; Value: MBS( "Schedule.EvaluateAfterDelay"; ,1; "MBS( \"Menubar.RunMenuCommand\"; 57606 )") // run Page Setup Dialog in 0.1 seconds  ] 

Pause/Resume Script [ Duration (seconds): 1 ] 

Save Records as PDF [ With dialog: Off ; “test A4 wide.pdf” ; Records being browsed ; Create folders: Off ] 

 

Set Variable [ $r ; Value: MBS( "PageSetupDialog.Disable" ) ] 

The example project will be included with next plugins. For Windows, please use Printer functions.

01 06 19 - 16:19
No comments

  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.