{"id":1764,"date":"2010-11-28T15:16:04","date_gmt":"2010-11-28T18:16:04","guid":{"rendered":"http:\/\/meiradarocha.jor.br\/news\/?p=1764"},"modified":"2010-11-29T16:45:32","modified_gmt":"2010-11-29T19:45:32","slug":"pagemaker-dialog-builder","status":"publish","type":"post","link":"https:\/\/meiradarocha.jor.br\/news\/2010\/11\/28\/pagemaker-dialog-builder\/","title":{"rendered":"PageMaker Dialog Builder"},"content":{"rendered":"<p><a href=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/pagemaker-splash.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-1775\" title=\"pagemaker-splash\" src=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/pagemaker-splash-300x212.jpg\" alt=\"\" width=\"300\" height=\"212\" srcset=\"https:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/pagemaker-splash-300x212.jpg 300w, https:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/pagemaker-splash-150x106.jpg 150w, https:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/pagemaker-splash.jpg 493w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>A linguagem <em>script <\/em>do <strong>PageMaker<\/strong> tem suporte para a constru\u00e7\u00e3o de caixas de di\u00e1logo, mas, o manual da linguagem dispon\u00edvel no CD do software n\u00e3o traz uma linha sequer sobre isto.<\/p>\n<p>Os <em>scripts <\/em>necessitam de posiconamento dos elementos atrav\u00e9s coordenadas absolutas. Como \u00e9 dif\u00edcil desenhar estes di\u00e1logos, o engenheiro da Adobe que desenvolveu o PM Scripter, <strong>Dr. Vladimir Samarskiy<\/strong>, escreveu uma s\u00e9rie de <em>scripts <\/em>que ajudam a se montar caixas de di\u00e1logo atrav\u00e9s de um documento do pr\u00f3prio <strong>PageMaker<\/strong>.<\/p>\n<p>O engenheiro russo tem uma <a href=\"http:\/\/www.oz.net\/~vsamarsk\/ScriptingTools.htm\">p\u00e1gina com estas ferramentas<\/a> h\u00e1 mais de 12 anos, mas coloco-as aqui para o caso de, algum dia, sua p\u00e1gina ser desativada.<\/p>\n<h2><a name=\"Dialog Builder\"><\/a>Dialog Builder<\/h2>\n<p><em>Use special kit of scripts and PageMaker to create a script which will display a dialog.<\/em><\/p>\n<p><strong><em>Vladimir Samarskiy<\/em><\/strong><\/p>\n<h4>Table of Contents<\/h4>\n<ul>\n<li> Scripts: <a href=\"#OpenDialogTemplate\">Open Dialog Template<\/a> | <a href=\"#AlignControls\">Align Controls<\/a> | <a href=\"#AdjustDB\">Adjust Dialog Box<\/a> | <a href=\"#TestDialog\">Test Dialog<\/a> | <a href=\"#SaveDialog\">Save Dialog<\/a><\/li>\n<li><a href=\"#Workflow\">Sample Workflow<\/a><\/li>\n<li> <em><span><a href=\"#x-platform\">Cross Platform Development<\/a><\/span><\/em><\/li>\n<li> <em><span><a href=\"#Download\">How to download&#8230;<\/a><\/span><\/em><\/li>\n<li><em> <a href=\"#Assistant\">Adobe Scripter<\/a><\/em><\/li>\n<\/ul>\n<p>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.<\/p>\n<h4><a name=\"OpenDialogTemplate\"><\/a>Open Dialog Template.<\/h4>\n<p>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.<\/p>\n<p>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\u00a0 position and size of the controls.<\/p>\n<p>To change size of the dialog box use either <strong>File &gt; Document Setup<\/strong> dialog or the script <a href=\"#AdjustDB\">Adjust Dialog Box<\/a> , to specify its position alternate zero point of the document.<\/p>\n<p><a href=\"#Download\">Download script Open Dialog Template.<\/a><\/p>\n<h4><a name=\"AlignControls\"><\/a>Align Controls.<\/h4>\n<p>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 &#8216;Cascade&#8217; options arranges centers of all selected objects into an arithmetical progression (outcome depends on the drawing order of the selected controls). The &#8216;Tile&#8217; options tiles controls by X or Y coordinate.\u00a0 Tile option is usually combined with left (top,right,bottom) alignment of the other coordinate.<\/p>\n<p>Script &#8216;Align Controls&#8217; expects several objects selected. If just one group (use Element &gt; Group or ^G) is selected, script modifies controls within the group.\u00a0 It is not recommended to apply the script when a group(s) and an individual controls are simultaneously selected.<\/p>\n<p><a href=\"#radiobuttons\">Click here<\/a> to see why would you use groups for dialog building.<\/p>\n<p><a href=\"#Download\">Download script Align Controls.<\/a><\/p>\n<h4><a name=\"AdjustDB\"><\/a>Adjust Dialog Box.<\/h4>\n<p>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\u00a0 to secure an inset in a positions of a controls.<\/p>\n<p><a href=\"#Download\">Download script Adjust Dialog Box<\/a><\/p>\n<h4><a name=\"TestDialog\"><\/a>Test Dialog<\/h4>\n<p>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 &#8216;Save Test Dialog&#8217;.<\/p>\n<p>Script &#8216;Test Dialog&#8217; can be used as a training tool when mastering in Dialog Builder.<\/p>\n<p><a href=\"#Download\">Download script Test Dialog<\/a><\/p>\n<h4><a name=\"SaveDialog\"><\/a>Save Dialog<\/h4>\n<p>Saves the newly created script in the same directory under the name specified<br \/>\nby user.<\/p>\n<p><a href=\"#Download\">Download script Save Dialog<\/a><\/p>\n<h4><a name=\"Workflow\"><\/a>Sample sequence of steps to create a dialog.<\/h4>\n<p>1. Run the script &#8216;Open Dialog Template&#8217;<\/p>\n<p>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.<\/p>\n<p>If you have radiobuttons in your dialog, join radiobuttons into a <strong><span style=\"text-decoration: underline;\">group<\/span><\/strong> ( Element &gt; 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.<\/p>\n<p>If one of the pushbuttons should be the default pushbutton, put it first in the display order (Element &gt; Arrange &gt; Send to Back)<\/p>\n<p>3. Use script &#8216;Align Controls&#8217; to refine mutual positions of the controls.<\/p>\n<p>4. Use script &#8216;Test Dialog&#8217;. Inspect dialog.\u00a0 Dismiss the dialog by pushing any pushbutton. To change number, size and position of controls return to step 2 or step 3.<\/p>\n<p>5. After you satisfied with the preview, use the script &#8216;<a href=\"#SaveDialog\">Save dialog<\/a>&#8216;. Type in a name of the script when prompted.\u00a0 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.\u00a0 Thus, for example, the PageMaker document below<\/p>\n<p><a href=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/Template.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1768\" title=\"Template\" src=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/Template-300x185.gif\" alt=\"\" width=\"300\" height=\"185\" \/><\/a><\/p>\n<p>yields the following dialog script:<\/p>\n<pre>Dialogbegin 0,0,187,98,\"Dialog caption\"\r\nCheckbox 72,23,127,39,\"Option 2\"\r\nCheckbox 72,3,128,18,\"Option 1\"\r\nPushbutton 24,80,86,95,\"OK\"\r\nStatic 3,55,65,70,\"Enter some text :\"\r\nEdit 71,55,122,70,\"Text entered.\"\r\nListbox 3,3,65,50,\"Item 1\",\"Item 2\",\"Item 3\",\"Item 4\",\"Item 5\",\"\"\r\nPushbutton 100,80,163,95,\"Cancel\"\r\nRadiobutton 134,3,184,18,\"Choice 1\"\r\nRadiobutton 134,21,184,37,\"Choice 2\"\r\nRadiobutton 134,40,184,56,\"Choice 3\"\r\nDialogend\r\nreturn<\/pre>\n<p>To refine this script:<\/p>\n<p>a)\u00a0 Replace<\/p>\n<pre>Radiobutton 134,3,184,18,\"Choice 1\"<\/pre>\n<p>with<\/p>\n<pre>Radiobutton 134,3,184,18,\"Choice 1\" , 1<\/pre>\n<p>to make sure that this radiobutton is checked at the initialization of the dialog.<\/p>\n<p>b) Remove &#8220;&#8221; at the end of the listbox definition statement. Most often extra &#8220;&#8221; 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.<\/p>\n<p>c) Move pushbutton &#8220;OK&#8221; statement immediately after the Dialogbegin statement to have &#8220;OK&#8221; button outlined or hilited as a default button.<\/p>\n<p>Now dialog script may look like that<\/p>\n<pre>Dialogbegin 0,0,187,98,\"Dialog caption\"\r\nPushbutton 24,80,86,95,\"OK\"\r\nPushbutton 100,80,163,95,\"Cancel\"\r\nCheckbox 72,23,127,39,\"Option 2\"\r\nCheckbox 72,3,128,18,\"Option 1\"\r\nStatic 3,55,65,70,\"Enter some text :\"\r\nEdit 71,55,122,70,\"Text entered.\"\r\nListbox 3,3,65,50,\"Item 1\",\"Item 2\",\"Item 3\",\"Item 4\",\"Item 5\"\r\nRadiobutton 134,3,184,18,\"Choice 1\",1\r\nRadiobutton 134,21,184,37,\"Choice 2\"\r\nRadiobutton 134,40,184,56,\"Choice 3\"\r\nDialogend\r\nreturn<\/pre>\n<p><a href=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/DLG.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1769\" title=\"DLG\" src=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/DLG-300x174.gif\" alt=\"\" width=\"300\" height=\"174\" \/><\/a><\/p>\n<h4><a name=\"x-platform\"><\/a>Cross platform script development.<\/h4>\n<p>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:<\/p>\n<p>When working on Windows and trying to get Macintosh dialog script, insert (temporary ) script line<\/p>\n<pre>platform = MACINTOSH<\/pre>\n<p>just after the line<\/p>\n<pre>getplatform &gt;&gt; platform<\/pre>\n<p>When working on Macintosh and trying to get Windows dialog script, insert ( temporary ) script line<\/p>\n<pre>platform = WINDOWS<\/pre>\n<p>just after the line<\/p>\n<pre>getplatform &gt;&gt; platform<\/pre>\n<p>Save Macintosh and Window scripts under different names and after that merge them into one if &#8230; endif statement:<\/p>\n<pre>getplatform &gt;&gt; platform\r\nif platform = WINDOWS\r\n  -- paste Windows dialog script here\r\nelse\r\n  -- paste Macintosh dialog script here\r\nendif<\/pre>\n<p>See, for example, cross platform dialog in the script <a href=\"#SaveDialog\">Save Dialog<\/a><\/p>\n<h4><a name=\"Download\"><\/a>How to download Dialog Builder<\/h4>\n<p>Store all the scripts from Dialog Building kit in one folder. Keep it within the folder &#8216;&#8230; PlugIns:Scripts&#8217; to make all scripts visible in the Script Palette.<\/p>\n<p>Shift-click (WIN) or click-hold (Mac) on a name below. When Save As common dialog\u00a0 appears navigate into the destination folder and drop script there. Do the same with other scripts.<\/p>\n<ul>\n<li><a href=\"http:\/\/www.oz.net\/~vsamarsk\/OpenDialogTemplate.spt\">Open Dialog Template<\/a><\/li>\n<li><a href=\"http:\/\/www.oz.net\/~vsamarsk\/AlignControls.spt\">Align Controls<\/a><\/li>\n<li><a href=\"http:\/\/www.oz.net\/~vsamarsk\/AdjustDialogBox.spt\">Adjust Dialog Box<\/a><\/li>\n<li><a href=\"http:\/\/www.oz.net\/~vsamarsk\/TestDialog.spt\">Test Dialog<\/a><\/li>\n<li><a href=\"http:\/\/www.oz.net\/~vsamarsk\/SaveDialog.spt\">Save Dialog<\/a><\/li>\n<\/ul>\n<p>[N. do Editor: <a href=\"http:\/\/meiradarocha.jor.br\/news\/wp-content\/uploads\/2010\/11\/Dialog-Builder.zip\">Baixe todos estes scripts, este manual e o execut\u00e1vel Adobe Scripter<\/a>. Coloque a pasta\u00a0 zipada na pasta de scripts do PageMaker, geralmente &#8220;<strong>c:\\Arquivos de programas\\Adobe\\PageMaker 7.0\\RSRC\\BRASIL\\PLUGINS\\Roteiros\\<\/strong>&#8220;.]<\/p>\n<h2><a name=\"Assistant\"><\/a>Adobe Scripter<\/h2>\n<p>Adobe Scripter is a stand alone application which helps to write, edit, run and debug scripts. Run this application simultaneously with PageMaker.<\/p>\n<p>This is a sketch of Scripter&#8217;s functionality following a menu commands.<\/p>\n<p>Application menu:<\/p>\n<ul>\n<li> <strong>File &gt; New :<\/strong> Opens new script. Default name of the script is &#8216;untitled.spt&#8217;. Application creates a file &#8216;untitled.spt&#8217; in its home directory. On Macintosh platform File &gt; New creates a new window so this menu command is available only after File &gt; Close<\/li>\n<li> <strong>File &gt; Open :<\/strong> Opens existing script. Supports only short \/ 8.3 \/ names of files and directories.<\/li>\n<li> <strong>File &gt; Save; File &gt; Save As<\/strong> :\u00a0 Saves the script in the text editor.In case of File &gt; Save saves previous version of the script with extension *.bak. Supports only short \/ 8.3 \/ names of files and directories.<\/li>\n<li> <strong>File &gt; Close<\/strong> (Macintosh only) Closes edit window.<\/li>\n<li> <strong>File &gt; Revert<\/strong> : Restores last saved script. (No &#8216;Watch your changes&#8217; warning.)<\/li>\n<li> <strong>File &gt; Print script; File &gt; Print Selection<\/strong> :\u00a0 PageMaker should be running to execute this menu command.<\/li>\n<li> <strong>File &gt; Quit<\/strong> &#8211; exit the application.<\/li>\n<li> <strong>Edit &gt; Undo<\/strong> : Undo\/Redo last Edit &gt; xxx action. (available only on Windows platform)<\/li>\n<li> <strong>Edit &gt; Cut ; Edit &gt; Copy ; Edit &gt; Paste ; Edit &gt; Select All<\/strong>&#8211; as expected. Editing of the script is disabled while script is stopped in the debugger.<\/li>\n<li><strong>Run &gt; Run<\/strong> : Starts running script or continues running if the script has been stopped in the debugger. Before the executing of the very first line of the script Scripter saves the script from the script editor to a disk. Previous version of the script gets extention *.bak.<\/li>\n<li> <strong>Run &gt; Step<\/strong> : Executes just one line of the script and stops. See log of executed commands in the right side of the application widow. If a subroutine<br \/>\noccurs, Run &gt; Step goes into it. One can use Run &gt; Step shortcut ( F 8) to throw currently running script into the debugger .<\/li>\n<li> <strong>Run &gt; Step Out<\/strong>.\u00a0 Completes the loop or subroutine, whichever is immediate, and stops in the debugger again.<\/li>\n<li> <strong>Run &gt; Reset<\/strong> : Stops the script; closes all scripts and subroutine files, however spares variables so that variables still can be inspected later on using\u00a0 Vars &gt; Inspect.<\/li>\n<li> <strong>Run &gt; Verify<\/strong> : Verifies script for errors. Before verification starts, script is saved to a disk ( no *.bak version for this action ).\u00a0 Click <a href=\"#Verifier\">here<\/a> to learn more about the Verifier<\/li>\n<li> <strong>Vars &gt; Inspect<\/strong> : Shows in the edit window list of all current variables ( including local ones of a subroutines ) and their current values. Use File &gt; Revert to reload script into the edit window. Note that Vars &gt; Inspect command does not save the content of the edit window to disk. It means that after Vars &gt; Inspect all unsaved modification of the script are lost. It is possible to continue tracing with variables in the edit window instead of the script.<\/li>\n<li> <strong>Vars &gt; Evaluate<\/strong> : To change current value of the variable edit the value to the left of the &#8216; = &#8216; and use Vars &gt; Evaluate command to update variables accordingly to the content of the edit window.<\/li>\n<li> <strong>Vars &gt; Erase<\/strong> : Erases all variables.<\/li>\n<p><strong>Warning<\/strong> : 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 <a href=\"http:\/\/www.oz.net\/~vsamarsk\/WinTOC.html#VaporWare\">upgrade<\/a> PMScript\/PMTrace engine to a new version to avoid a software conflict.<\/ul>\n<h4><a name=\"Verifier\"><\/a>Verifier<\/h4>\n<p>Verifier ( Run &gt; Verify ) reads all lines of the script one by one and checks lines for possible errors.<\/p>\n<ol>\n<li>Checks matching pairs of the script commands like if &#8211; endif, repeat &#8211; until etc. and how these constructs are nested.<\/li>\n<li>Checks syntax of the expressions that PMScript will have to calculate in the run time. Note that type of a variable ( number, string ) is defined at the run time, hence verifier gives no warranty that operations and functions will be applied to right type of variables. Instead Verifier only checks brackets and signs of operations without going any deep.<\/li>\n<\/ol>\n<p>There are cases when Verifier is more strict then actual PMScript &#8211; see <a href=\"#TestVerifier\">test report.<\/a> If Verifier did not find errors, it indents script lines accordingly to how programming constructs are nested.<\/p>\n<p>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.<\/p>\n<p>Verifier is the most recent feature of the script engine, please let me know if \/ where it fails. (vsamarsk@oz.net)<\/p>\n<p>Download <a href=\"http:\/\/www.oz.net\/~vsamarsk\/PMScrDev.exe\">WIN95<\/a> or <a href=\"http:\/\/www.oz.net\/~vsamarsk\/PMScrDev.sit.hqx\">MACINTOSH<\/a> version of the aplication. (Windows version of Scripter is not enough tested on WinNT )<\/p>\n<p><strong><em>Last update: 02\/10\/98<\/em><\/strong><\/p>\n<h5><a name=\"TestVerifier\"><\/a>Test report.<\/h5>\n<p>Verifier has been tested against scripts shipped with PageMaker 6.5. It failed to certify the following scripts:<\/p>\n<p>1) Ligatures &#8230; spt, New Object Layers.spt &#8211; because dialogbegin &#8211; dialogend construct should be properly nested within if &#8211; endif construct. To meet this requirement, edit &gt; cut dialogend line outside of the if &#8211; endif construct and edit &gt; paste it twice into WINDOWS and MACINTOSH section of the dialog<br \/>\n2) Hanging character.spt &#8211; &#8216;;&#8217; is not allowed in the comments because &#8216;;&#8217; may mark end of the line. Replace<\/p>\n<pre>\/\/ check if para is empty; if yes - bail out<\/pre>\n<p>with<\/p>\n<pre>\/\/ check if para is empty, if yes - bail out<\/pre>\n<p>3) Styles info, Resize group, Number paragraphs &#8211; Memory overflow. Too long scripts for this version of Verifier.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A linguagem script do PageMaker tem suporte para a constru\u00e7\u00e3o de caixas de di\u00e1logo. C<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,19],"tags":[],"class_list":["post-1764","post","type-post","status-publish","format-standard","hentry","category-diagramacao","category-pagemaker"],"_links":{"self":[{"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/posts\/1764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/comments?post=1764"}],"version-history":[{"count":0,"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/posts\/1764\/revisions"}],"wp:attachment":[{"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/media?parent=1764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/categories?post=1764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meiradarocha.jor.br\/news\/wp-json\/wp\/v2\/tags?post=1764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}