"Mail merge" for OmniGraffle

Greg Titus greg at omnigroup.com
Wed Nov 5 15:05:46 PST 2003


On Nov 5, 2003, at 2:59 AM, leb.omni at baltz.org wrote:

> Hi,
>
> I'm interested in trying to use OmniGraffle to print labels/business 
> cards where the text on the labels is auto generated from some data 
> source (XML, plain text, SQL database,LDAP) and static content is laid 
> out in OmniGraffle (i.e. I don't want to insert the text by hand each 
> time).  This could be used to create address labels (which I'm not 
> doing) or business cards (which I'm sort of doing).  What I actually 
> want to do is create access voucher cards for an Internet access kiosk 
> with user names and passwords.
>
> So, I'm looking for any of:
>   * existing solutions, if there are any
>   * similar plug-ins or scripts that might be morfed into a 
> label/b-card tool
>   * suggestion on the best/simplest way to extend OmniGraffle to do 
> this
>       (AppleScript, plug-in, etc.)
>
> The more detailed suggestions the better :-) I've never hacked 
> OmniGraffle before and this looks like a good excuse to me.

There is one existing solution: DayLite 1.5 <www.marketcircle.com>

Their contact and sales management product can do mail merges into 
Graffle diagrams, and is especially useful for overlaying contact data 
on PDF forms and existing documents. Very cool feature for things like 
real estate forms, I'm told...

The way that DayLite does it, and what you'll probably want to do, is 
by generating AppleScript and then feeding the AppleScript to Graffle. 
It's as simple as:

tell first document of application "OmniGraffle"
	replace string "$(username)" replacement "greg"
	replace string "$(password)" replacement "foo"
end tell

You can use whatever convention you like for the strings to replace - 
OmniGraffle is just doing a "replace all" on the text of every shape 
and line label on each page of the document.

Hope this helps,
	- Greg



More information about the OmniGraffle-Users mailing list