Is there a command like "hide table column" in ASS

I have a preferences window that allows the user to put a check by the names of all of the possible columns to be displayed in the Main Table. Is there a command like “hide table column” or some way to hide any columns that the user does not have checked in preferences?

I did get it to work by creating no table columns in IB, then adding them to the table as the user selects them in prefs. However–without a column in IB to reference–applescript errors when the column is clicked by the user for sorting purposes.

Any ideas?

Thanks,

John

I’m sure there’s a better way to do this but make your table in IB with all of the columns that could possibly be in it. Then to toggle visiblity, you can adjust the width of the columns as necessary, setting a width of 0 essentially makes it invisible:

tell window "main"
    set the_table to table view 1 of scroll view 1
    set old_width to width of table column 1 of the_table
    set old_min_width to minimum width of table column 1 of the_table
    set minimum width of table column 1 of the_table to 0
    set width of table column 1 of the_table to 0
    update
    delay 2
    set width of table column 1 of the_table to old_width
    set minimum width of table column 1 of the_table to old_min_width
end tell

Jon

I wish there were a better way of doing it. I have a number of columns I need to toggle between visiblity and invisibility, but zero width columns unfortunately still take up a small amount of width, and throw my horizontal spacing off visually.

Set the minimum widths and widths to a negative number. -3 seems to work when vertical lines are used.

http://osdir.com/ml/applescript-studio/2009-08/msg00013.html

call method "setHidden:" of theTableColumn with parameter true