WHAT WORKS ...
What my script needed to do was create a new folder with only certain columns visible.
Here is my test script ...
tell application "Finder"
activate
if not (exists folder "test folder" of (path to desktop)) then
set folderAlias to make new folder at (path to desktop) with properties {name:"test folder"}
my setWindowAttributes(folderAlias, true, false, false)
else
set folderAlias to (folder "test folder" of (path to desktop)) as alias
end if
-- insert test scripting here
open window of folderAlias
beep
end tell
on setWindowAttributes(folderAlias, showModDate, showComment, sortByName)
tell application "Finder"
set winRef to (window of folderAlias)
set current view of winRef to list view
-- set icon size of list view options of winRef to small -- move to end. Sets cols to default.
ignoring application responses
set visible of column index 2 of list view options of winRef to showModDate -- mod date
set visible of column index 3 of list view options of winRef to false -- creation date
set visible of column index 4 of list view options of winRef to false -- size
set visible of column index 5 of list view options of winRef to false -- kind
set visible of column index 6 of list view options of winRef to false -- label
set visible of column index 7 of list view options of winRef to false -- version
set visible of column index 8 of list view options of winRef to showComment -- comment
set uses relative dates of list view options of winRef to false
set shows icon preview of list view options of winRef to false
if showComment then
set width of column index 1 of list view options of winRef to 300
else
set width of column index 1 of list view options of winRef to 340
end if
if sortByName then
set sort column of list view options of winRef to name column
set sort direction of sort column of list view options of winRef to normal
else if showModDate then
set sort column of list view options of winRef to modification date column
set sort direction of sort column of list view options of winRef to reversed -- most recent at top
end if
try
set toolbar visible of winRef to false -- waiting for bug to be fixed. Window must be open.
end try
set icon size of list view options of winRef to small
end ignoring
end tell
end setWindowAttributes ----------------------------------------------
WHAT DOES NOT WORK ...
As far as I can tell from my experiments, the value (true/false) of a column's visible property is recorded properly as verified by using