tell application "Adobe InDesign CS3"
set ms to selection
set aTable to parent of item 1 of ms
if class of aTable ? table then
set aTable to parent of aTable
if class of aTable ? table then
display dialog "no table selected"
return
end if
end if
set nC to count columns in aTable
set tWidth to 0.0
repeat with n from 1 to nC
set aWidth to (width of (column n of aTable))
set tWidth to tWidth + aWidth
end repeat
set myDialog to make dialog with properties {name:"Set Width of Table"}
tell myDialog
make dialog column
tell the result
set tNuWidth to make measurement editbox with properties {edit value:(tWidth * 2.83465), edit units:millimeters}
end tell
end tell
set nu to show myDialog
if nu is true then
set nuWidth to (edit value of tNuWidth) * 0.35278
set scaleClm to nuWidth / tWidth
repeat with n from 1 to nC
set aWidth to (width of (column n of aTable))
set width of column n of aTable to (scaleClm * aWidth)
end repeat
else
destroy myDialog
return
end if
end tell