Take a survey

Developing Applications Using APIs > Converting Between File Formats and PDF > Adding Support for Additional Native File Formats > XML files > Script XML file

Script XML file
The following example specifies how PDF Generator ES should interact with Notepad to print files by using the Adobe PDF printer. The section Script XML reference describes the script grammar.
Example: Notepad script XML file (appmon.notepad.script.en_US.xml)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
*
* ADOBE CONFIDENTIAL
* ___________________
* Copyright 2004 - 2005 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
*-->
 
<!-- This file automates printing of text files via Notepad to the Adobe PDF printer. In order to see the complete hierarchy it is recommended that you use Microsoft Spy++ which details the properties of windows necessary to write scripts. In this sample there are total of eight steps-->
 
<application name="Notepad" version="7.0" locale="en_US" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="scripts.xsd">
 
<!-- In this step, wait for the application window to appear. Notice the use of the regular expression ".*", which means any number of non-terminating characters. -->
	<step>
		<expectedWindow>
			<window caption=".*Notepad"/>
		</expectedWindow>
	</step>
	
<!--In this step, acquire the application window and send File->Open menu bar and menu item commands with the expectation that this is the windows Open dialog box-->		
	<step>
		<acquiredWindow>
			<window caption=".*Notepad">
				<virtualInput>
					<menuBar>
						<selection>
							<name>File</name>
						</selection>
						<selection>
							<name>Open...</name>
						</selection>
					</menuBar>
				</virtualInput>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Open"/>
		</expectedWindow>
	</step>
	
	<!-- In this step, acquire the Open window, select the Edit sub-menu and input the source path. Then click the Open button. The expectation of this 'action' is that the Open dialog box will disappear -->
	<step>
		<acquiredWindow>
			<window caption="Open">
				<windowList>
					<window className="ComboBoxEx32">
						<windowList>
							<window className="ComboBox">
								<windowList>
									<window className="Edit" action="inputSourcePath"/>
								</windowList>
							</window>
						</windowList>
					</window>
				</windowList>
				<windowList>
					<window className="Button" caption="Open" action="press"/>
				</windowList>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Open" action="disappear"/>
		</expectedWindow>
		<pause value="30"/>
	</step>
	
	<!-- In this step, acquire the application window and send the File > Print menu bar and menu item commands, with the expectation that this is the windows Print dialog box-->
	<step>
		<acquiredWindow>
			<window caption=".*Notepad">
				<virtualInput>
					<menuBar>
						<selection>
							<name>File</name>
						</selection>
						<selection>
							<name>Print...</name>
						</selection>
					</menuBar>
				</virtualInput>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Print">
		</window>
		</expectedWindow>
	</step>
	
	<!-- In this step, acquire the Print dialog box and click the Preferences button. The expected window in this case is the Printing Preferences dialog box-->
	<step>
		<acquiredWindow>
			<window caption="Print">
				<windowList>
					<window caption="General">
						<windowList>
							<window className="Button" caption="Preferences"
								action="press"/>
						</windowList>
					</window>
				</windowList>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Printing Preferences"/>
		</expectedWindow>
	</step>
	
	<!-- In this step, acquire the Printing Preferences dialog box and select the combo box which is the 10th child of the window with the caption '"Adobe PDF Settings' and select the first index. (Note: All indices start with 0. Also, uncheck the box that has the caption '"View Adobe PDF results' and click OK. The expectation is that the Printing Preferences dialog box disappears. -->
	<step>
		<acquiredWindow>
			<window caption="Printing Preferences">
				<windowList>
					<window caption="Adobe PDF Settings">
						<windowList>
							<window className="ComboBox" childIndex="10">
								<virtualInput>
									<index value="1"/>
								</virtualInput>
							</window>
						</windowList>
						<windowList>
							<window className="Button" caption="View Adobe PDF results"
								action="uncheck"/>
						</windowList>
					</window>
				</windowList>
				<windowList>
					<window className="Button" caption="OK" action="press"/>
				</windowList>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Printing Preferences" action="disappear"/>
		</expectedWindow>
	</step>
	
	<!-- In this step, acquire the Print dialog box and click the Print button. The expectation is that the dialog box with the caption 'Print' disappears. In this case use the regular expression '^Print$' for specifying the caption, given that there could be multiple dialog boxes with captions that include the word "Print". -->
	<step>
		<acquiredWindow>
			<window caption="Print">
				<windowList>
					<window caption="General"/>
					<window className="Button" caption="^Print$" action="press"/>
				</windowList>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Print" action="disappear"/>
		</expectedWindow>
	</step>
	
	<!-- Finally, in this step acquire the dialog box with the caption "Save PDF File As". In the Edit window type the destination path for the output PDF file and click the Save button. The expectation is that the dialog box disappears-->
	<step>
		<acquiredWindow>
			<window caption="Save PDF File As">
				<windowList>
					<window className="ComboBoxEx32">
						<windowList>
							<window className="ComboBox">
								<windowList>
									<window className="Edit"
										action="inputDestinationPath"/>
								</windowList>
							</window>
						</windowList>
					</window>
				</windowList>
				<windowList>
					<window className="Button" caption="Save" action="press"/>
				</windowList>
			</window>
		</acquiredWindow>
		<expectedWindow>
			<window caption="Save PDF File As" action="disappear"/>
		</expectedWindow>
	</step>
	
	<!-- We can always set a retry count or a maximum time for a step. In case we surpass these limitations, PDF Generator ES generates this abort message and terminates processing. -->
	<abortMessage msg="15078"/>
</application>
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/generatePdfPDFG_DG_AppMon.65.22.html