Os scripts necessitam de posiconamento dos elementos através coordenadas absolutas. Como é difícil desenhar estes diálogos, o engenheiro da Adobe que desenvolveu o PM Scripter, Dr. Vladimir Samarskiy, escreveu uma série de scripts que ajudam a se montar caixas de diálogo através de um documento do próprio PageMaker.
O engenheiro russo tem uma página com estas ferramentas há mais de 12 anos, mas coloco-as aqui para o caso de, algum dia, sua página ser desativada.
Use special kit of scripts and PageMaker to create a script which will display a dialog.
Vladimir Samarskiy
Dialog Builder is a family of several miscellaneous scripts. When used all together this scripts can significantly simplify development of dialog segment in your script.
This script creates a PageMaker document. The only page of the document is empty, but above the page on the pasteboard there are colored PageMaker text frames in piles. Each color corresponds to a certain type of a control. Initial text in the frame also hints on the control type.
Consider the page as a dialog box and text frames dragged onto the page from the pasteboard piles as a controls. One can move and reshape controls with the pointer tool and also edit text within the frames with a text tool thus modifying a caption or content of the control. Script Align Controls helps to refine position and size of the controls.
To change size of the dialog box use either File > Document Setup dialog or the script Adjust Dialog Box , to specify its position alternate zero point of the document.
Download script Open Dialog Template.
Apply the script when several controls are selected. To align controls horizontally and/or vertically check corresponding checkbox and a radiobutton below the checkbox. Align left (top, right, bottom) means alignment to a leftmost (topmost, rightmost, botommost) position among all selected controls. For central alignment script will calculate average coordinate of all centers. The ‘Cascade’ options arranges centers of all selected objects into an arithmetical progression (outcome depends on the drawing order of the selected controls). The ‘Tile’ options tiles controls by X or Y coordinate. Tile option is usually combined with left (top,right,bottom) alignment of the other coordinate.
Script ‘Align Controls’ expects several objects selected. If just one group (use Element > Group or ^G) is selected, script modifies controls within the group. It is not recommended to apply the script when a group(s) and an individual controls are simultaneously selected.
Click here to see why would you use groups for dialog building.
Download script Align Controls.
This script will change page size of the document so that all objects on the page fit within margin box. Margins are not shown in the outcome dialog, hence margins can be used to secure an inset in a positions of a controls.
Download script Adjust Dialog Box
When you are done with positioning controls on the page, run the script to see the dialog preview. Exit from a dialog by any pushbutton or GoAway button. After inspecting the preview, dialog can be either alternate further on or save the outcome using script ‘Save Test Dialog’.
Script ‘Test Dialog’ can be used as a training tool when mastering in Dialog Builder.
Saves the newly created script in the same directory under the name specified
by user.
1. Run the script ‘Open Dialog Template’
2. Using a pointer tool, drag from the pasteboard piles onto the page as many controls as you need. Put them in the positions you would like to see them in a dialog. Only move and resize controls, do not rotate, reflect or skew them. Controls should not overlap each other.
If you have radiobuttons in your dialog, join radiobuttons into a group ( Element > Group or ^G ), thus ensuring their adjacent position in the display order. This is necessary or the Dialog Builder to understand these that the radiobuttons form a group and only one of them can be checked at a time.
If one of the pushbuttons should be the default pushbutton, put it first in the display order (Element > Arrange > Send to Back)
3. Use script ‘Align Controls’ to refine mutual positions of the controls.
4. Use script ‘Test Dialog’. Inspect dialog. Dismiss the dialog by pushing any pushbutton. To change number, size and position of controls return to step 2 or step 3.
5. After you satisfied with the preview, use the script ‘Save dialog‘. Type in a name of the script when prompted. Do not specify path in the filename edit window. Outcome script will be saved into the same directory where Dialog Builder scripts are located. 6. (Optionally) Now open the script in the script palette, copy it to clipboard (^C ) and paste into the script you are working on. I hope that amount of adjusting changes in the script will be minimal. Thus, for example, the PageMaker document below
yields the following dialog script:
Dialogbegin 0,0,187,98,"Dialog caption" Checkbox 72,23,127,39,"Option 2" Checkbox 72,3,128,18,"Option 1" Pushbutton 24,80,86,95,"OK" Static 3,55,65,70,"Enter some text :" Edit 71,55,122,70,"Text entered." Listbox 3,3,65,50,"Item 1","Item 2","Item 3","Item 4","Item 5","" Pushbutton 100,80,163,95,"Cancel" Radiobutton 134,3,184,18,"Choice 1" Radiobutton 134,21,184,37,"Choice 2" Radiobutton 134,40,184,56,"Choice 3" Dialogend return
To refine this script:
a) Replace
Radiobutton 134,3,184,18,"Choice 1"
with
Radiobutton 134,3,184,18,"Choice 1" , 1
to make sure that this radiobutton is checked at the initialization of the dialog.
b) Remove “” at the end of the listbox definition statement. Most often extra “” in the listbox definition is due to extra carriage returns typed into the text frame used for a listbox representation. Dialog Builder considers every paragraph as a list item and does not check if list item is empty.
c) Move pushbutton “OK” statement immediately after the Dialogbegin statement to have “OK” button outlined or hilited as a default button.
Now dialog script may look like that
Dialogbegin 0,0,187,98,"Dialog caption" Pushbutton 24,80,86,95,"OK" Pushbutton 100,80,163,95,"Cancel" Checkbox 72,23,127,39,"Option 2" Checkbox 72,3,128,18,"Option 1" Static 3,55,65,70,"Enter some text :" Edit 71,55,122,70,"Text entered." Listbox 3,3,65,50,"Item 1","Item 2","Item 3","Item 4","Item 5" Radiobutton 134,3,184,18,"Choice 1",1 Radiobutton 134,21,184,37,"Choice 2" Radiobutton 134,40,184,56,"Choice 3" Dialogend return
Dialog Builder builds a dialog script valid for the platform on which Dialog Builder is installed. For example, if you are working in Windows the resulting script will look fine on Windows but not on Macintosh. To obtain dialog script for another platform, script Save Dialog should be edited as follows:
When working on Windows and trying to get Macintosh dialog script, insert (temporary ) script line
platform = MACINTOSH
just after the line
getplatform >> platform
When working on Macintosh and trying to get Windows dialog script, insert ( temporary ) script line
platform = WINDOWS
just after the line
getplatform >> platform
Save Macintosh and Window scripts under different names and after that merge them into one if … endif statement:
getplatform >> platform if platform = WINDOWS -- paste Windows dialog script here else -- paste Macintosh dialog script here endif
See, for example, cross platform dialog in the script Save Dialog
Store all the scripts from Dialog Building kit in one folder. Keep it within the folder ‘… PlugIns:Scripts’ to make all scripts visible in the Script Palette.
Shift-click (WIN) or click-hold (Mac) on a name below. When Save As common dialog appears navigate into the destination folder and drop script there. Do the same with other scripts.
[N. do Editor: Baixe todos estes scripts, este manual e o executável Adobe Scripter. Coloque a pasta zipada na pasta de scripts do PageMaker, geralmente “c:\Arquivos de programas\Adobe\PageMaker 7.0\RSRC\BRASIL\PLUGINS\Roteiros\“.]
Adobe Scripter is a stand alone application which helps to write, edit, run and debug scripts. Run this application simultaneously with PageMaker.
This is a sketch of Scripter’s functionality following a menu commands.
Application menu:
Warning : On Windows platform it is not possible to use the Script Palette for executing or tracing a script if Adobe Scripter is running. To avoid this conflict when Adobe Scripter is opened run all scripts using Adobe Scripter ( e.g. copy / paste the script into the Adobe Scripter edit window ) or upgrade PMScript/PMTrace engine to a new version to avoid a software conflict.
Verifier ( Run > Verify ) reads all lines of the script one by one and checks lines for possible errors.
There are cases when Verifier is more strict then actual PMScript – see test report. If Verifier did not find errors, it indents script lines accordingly to how programming constructs are nested.
Verifier can find and report only one error at a time. When Verifier encounters an error it places error information as a comments at the erroneous line at stops verification.
Verifier is the most recent feature of the script engine, please let me know if / where it fails. (vsamarsk@oz.net)
Download WIN95 or MACINTOSH version of the aplication. (Windows version of Scripter is not enough tested on WinNT )
Last update: 02/10/98
Verifier has been tested against scripts shipped with PageMaker 6.5. It failed to certify the following scripts:
1) Ligatures … spt, New Object Layers.spt – because dialogbegin – dialogend construct should be properly nested within if – endif construct. To meet this requirement, edit > cut dialogend line outside of the if – endif construct and edit > paste it twice into WINDOWS and MACINTOSH section of the dialog
2) Hanging character.spt – ‘;’ is not allowed in the comments because ‘;’ may mark end of the line. Replace
// check if para is empty; if yes - bail out
with
// check if para is empty, if yes - bail out
3) Styles info, Resize group, Number paragraphs – Memory overflow. Too long scripts for this version of Verifier.
Colheita de soja. Foto: Wenderson Araujo/Trilux Fotógrafos de mídias rurais já perderam a conta das…
João Batista MezzomoAuditor fiscal O que está por trás de tudo o que está acontecendo…
A.k.a. "SexyCyborg". A mulher do século 21. Naomi Wu testa seu iluminador de implantes na…
A principal ferramenta do jornalista de dados é a planilha, tipo LibreOffice Calc, M.S. Excel…
Rita Almeida, 9 de março de 2019 Psicóloga Rita Almeida: não delirantes, mas deliroides. Não…
Rafael Azzi5 de outubro de 2018 Você se pergunta como um candidato com tão poucas…