"Mail merge" for OmniGraffle
Thom Brooks
omni_groupie at unithom.com
Thu Nov 6 11:39:12 PST 2003
I realized that the OG data format is XML, so it's easy to 'chunk it out' and
determine which part of the file corresponds to each object, line, etc.
So I used PHP's PEAR Library class HTML::IntegratedTemplate to substitute
<!-- BEGIN myblock -->'blocks' of text<!-- END myblock --> and individual
values for tags like {THISONE}. I took a nearly blank document (with only one
object in it, containing one line of text) and marked it up so I could use it
as a base template. Then as I iterated over my dataset, I created new objects
as needed and inserted those blocks into my finished output.
Although my solution was created in order to help me interrogate the schema of
MySQL databases and auto-create ERD objects, it wouldn't be hard to change to
parse CSV data, and create one object per line (or however).
More information on HTML::IntegratedTemplate is available at
http://pear.php.net/manual/en/package.html.html-template-it.php
If you'd like to check out my MySQL -> OmniGraffle ERD tool, it's at
http://www.unithom.com/omnistuff/ERD_Maker.tgz
HTH,
Thom Brooks
On Wed, 5 Nov 2003 leb.omni at baltz.org wrote:
> 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.
More information about the OmniGraffle-Users
mailing list