Endicia for Mac XML Automation

The May 2007 USPS Rates have required an update to our XML.
There is a new XML specification

You can automate Endicia for Mac using XML command files. We have based our command structure on the DAZzle XML specification.

Please Note: Endicia for Mac does not yet support many of the commands offered in this document. Currently there is support for the PRINTING command as well as the XML log export.

Here are the only printing parameters currently supported:

Here is an example of a sample XML command structure to print a package:

<DAZzle Start="PRINTING" Prompt="NO"
OutputFile="~/Documents/endicia-out.xml" Test="NO">
<Package ID="1">
    <MailClass>PRIORITY</MailClass>
    <FlatRate>FALSE</FlatRate>
    <DateAdvance>1</DateAdvance>
    <WeightOz>5</WeightOz>
    <TotalPostage></TotalPostage>
    <Services DeliveryConfirmation="ON" InsuredMail="OFF"></Services>
    <Value>14.00</Value>
    <Description>test 1</Description>
    <ToName>Aaron Tuller</ToName>
    <ToCompany>buyolympia.com</ToCompany>
    <ToAddress1>929 Legion Way SE</ToAddress1>
    <ToAddress2></ToAddress2>
    <ToCity>Olympia</ToCity>
    <ToState>WA</ToState>
    <ToPostalCode>98501</ToPostalCode>
</Package>
</DAZzle>

 

Here is an example of the OutputFile contents:

<DAZzle><Package ID="1">
<Status>Success</Status>
<PIC>01805213907475654368</PIC>
<FinalPostage>3.85</FinalPostage>
<TransactionID>3151</TransactionID>
<TransactionDateTime>20040504151239</TransactionDateTime>
<PostmarkDate>20040505</PostmarkDate>
<ReferenceID></ReferenceID>
</Package>
</DAZzle>

 

The XML file can contain multiple packages.

Getting the XML file into Endicia for Mac

Once you have your XML file, there are multiple ways to process it.

Using AppleScript

Example:

tell application "Endicia"
    process XML file at "/Users/tullera/input.xml"
end tell

Via Command Line Endicia Tool

This is a separate executable from Endicia for Mac itself, and can be found in the "Extras" folder of the Endicia for Mac download.

./endiciatool -f /Users/tullera/input.xml

Print From External XML File

From the File menu there is a menu option for processing an XML file named "Print From External XML File". This is useful for checking individual files for syntax.