views:

216

answers:

2

Has anyone tried exporting data to Numbers in iWork? I want to generate a spreadsheet programmatically but I'm not having much success.

I've tried unzipping a .numbers document and analysing the XML to see if I could interpret it but it's far too complicated. Also, I couldn't find the DTDs used by Apple.

Judging by what's out there this is an almost impossible task. Does anyone have any ideas?

A: 

If they're pure number in one sheet, export them into a CSV or tab-separated text file.

KennyTM
I want to generate a spreadsheet programmatically. I'd like to give my users the ability to double click on a file and have it open in numbers without any fuss.
Rui Pacheco
A: 

I have a number of Applescript scripts in my application for generating Numbers spreadsheets. It works fairly well although it's not very quick and you don't have much control over formatting and can't insert things like Charts.

Ian Turner
That would be enough for me. Do you need to have iWorks installed for the scripts to work?
Rui Pacheco
Yes, you will need to install iWork to see the Applescript dictionary for the iWork applications and to try them out. It's usually much easier to get them working in Script Editor before moving them over to Cocoa.
Ian Turner