Page 1 of 1

Macro to reformat many tables?

Posted: 2007-06-05 06:20:02
by ssampler
From Word I imported an rtf file with many tables. Most are ill-formed and need to be reformatted. I want to apply the command "Fit to Contents" to all the tables in the document.

I know that I can put a menu macro "Table:Fit to Contents" inside an Applescript. However, for the "Fit to Contents" command to work, it is necessary to click inside a table. Is there (or will there be) a way of automating this process?

Thanks,
Steve

Posted: 2007-06-05 14:44:06
by martin
I believe the "Select Next Table" macro command behaves badly in the current public beta, but once NWP is out this should do what you like:

Code: Select all

Set Selection 1, 0 # move to start of document
While Select Next Table
	Menu "Table:Fit to Contents"
End

Posted: 2007-06-06 06:45:25
by ssampler
Thanks, Martin!