Script Reference : Window
A Window object represents main priPrinter window. This class is accessible via window variable.
Name | Type | Description |
---|---|---|
ribbon | string | Name of active ribbon tab. Following tabs are available for selection: "layout", "insert","view", "crop", "forms", "effects", "pdf". It is possible to select any tab by changing this property. |
status | string | Text in the status bar. |
title | string | Main priPrinter window title. |
visible | bool | Visiblity status. |
locale | string | Current translation. Read only. |
version | string | Full software name and version number. Read only. |
build | integer | priPrinter Build number. Read only. |
pos | Rect | Window coordinates.
window.pos=Rect(10,10,1024+10,768+10); |
zoom | float | Content scale factor. This value is the size of one paper mm
in screen pixels. 1.0 means that one mm is equal to one screen
pixel. window.zoom=window.zoom100; This code sets 100% zoom. window.zoom=window.zoom100/2; 50% |
zoom100 | float | Read only. Size of one mm in pixels for 100% zoom mode. |
Name | Return Type | Description |
---|---|---|
Document GetDocument() | Document | Method retrieves the main document object. |
Documets
bool Open(string) |
bool | Opens the document from a file. |
bool SaveAs(string) | bool | Saves the document |
bool Merge(string) | void | Merge another document from a file. This document will be the last one in the list of loaded documents. |
void Close() | void | Closes the loaded document. |
Window
Minimize() |
void | The Minimize method causes the window to be minimized (reduced to an icon). |
Maximize() | void | The Maximize method maximizes the windows's size. |
Restore() | void | The Restore method restores the window to its normal size. |
Commands
DoCommand(string) |
void | The DoCommand method "clicks" on specified button. In order to get name of command hover mouse pointer at required button and hold Shift+Ctrl keys. |
bool IsChecked(string) | bool | Method allows to check status of any command. |
Exit() | void | Exit priPrinter. This method only sets the internal flag, script will continue its execution and only after that priPrinter will be closed. |
Files & Folders
string GetFolder(string) |
string | Retrieves the path of a special folder, identified by string
id. "app" "data" - appplication data folder "arc" "form" "locale" "theme" "pdf" "art" "symbol" "script" "doc" "printed" - printed documents |
string GetRecentFile(int i) | string | Retrieves file name in the file history. Method returns NULL in case if index is not valid. See example below. |
Dialogs
bool PageSetupDialog() |
bool | Method launches page setup dialog. |
bool PrinterSetupDialog() | bool | Method launches printer setup dialog. |
bool SysPrinterSetupDialog() | bool | Method launches system printer setup dialog. |
About() | void | Displays priPrinter about dialog. |
string OpenFileDialog(string file, string filter) | string | Prompts the user to open a file. |
string SaveFileDialog(string file, string filter) | string | Prompts the user to save a file. |
string BrowseForFolder(string folder, string title) | string | Prompts the user to select any existimg folder. |
Sample 1:
print(window.GetFolder("arc")); print(window.locale); local i=0; while(1) { local str=window.GetRecentFile(i); if(str) { print("> " +i.tostring()+" " +str+"\n") ; i++; }else break; }
Show History window in case if it was not shown already.
if(!window.IsChecked("view.history")) window.DoCommand("view.history");