Hello all!
I’m working on a Desktop setup script.
I have several issues:
Finder gets an error: Can’t set sort column to kind, even though I have visible set to true.
Also, does anyone know if you can sort by group -as in group by kind? Any help on this would be much appreciated.
set chooseWindowLeft to choose folder
set chooseWindowRight to choose folder
--in order to take advantage of whole screen, check to see if dock is hidden, if not hide dock
tell application "System Events"
get autohide of the dock preferences
if result is false then
set autohide of dock preferences to true
end if
end tell
--with dock hidden, and folders chosen, two Finder windows will open up and be positioned vertically on the left and right side of the desktop
tell application "Finder"
(*using container windows maybe a better way to execute this script:*)
--chooseWindowLeft
tell the front Finder window
open chooseWindowLeft
set the properties to {bounds:{0, 25, 640, 802}, current view:list view, toolbar visible:true, statusbar visible:true, pathbar visible:true, sidebar width:190}
end tell
tell list view options of the front Finder window
set the properties to {calculates folder sizes:false, shows icon preview:true, icon size:small, text size:12, uses relative dates:true, sort column:modification date column}
tell column name column
set properties to ¬
{index:1, sort direction:normal, width:120, visible:true}
end tell
tell column size column
set properties to ¬
{index:5, sort direction:normal, width:72, visible:true}
end tell
tell column modification date column
set properties to ¬
{index:2, sort direction:normal, width:120, visible:true}
end tell
tell column creation date column
set properties to ¬
{index:4, sort direction:normal, width:120, visible:true}
end tell
tell column kind column
set properties to ¬
{index:3, sort direction:normal, width:120, visible:true}
end tell
tell column label column
set properties to ¬
{index:6, sort direction:normal, width:72, visible:false}
end tell
tell column version column
set properties to ¬
{index:7, sort direction:normal, width:72, visible:false}
end tell
tell column comment column
set properties to ¬
{index:8, sort direction:normal, width:120, visible:false}
end tell
end tell
set sort column to kind
set current view of the front Finder window to list view
set the current view of the window of every folder of chooseWindowLeft to list view
--chooseWindowRight
tell the front Finder window
open chooseWindowRight
set the properties to {bounds:{639, 23, 1279, 800}, current view:list view, toolbar visible:false, statusbar visible:true, pathbar visible:true, sidebar width:0}
end tell
tell list view options of the front Finder window
set the properties to {calculates folder sizes:false, shows icon preview:true, icon size:small, text size:12, uses relative dates:true, sort column:modification date column}
tell column name column
set properties to ¬
{index:1, sort direction:normal, width:120, visible:true}
end tell
tell column size column
set properties to ¬
{index:5, sort direction:normal, width:72, visible:true}
end tell
tell column modification date column
set properties to ¬
{index:2, sort direction:normal, width:120, visible:true}
end tell
tell column creation date column
set properties to ¬
{index:4, sort direction:normal, width:120, visible:true}
end tell
tell column kind column
set properties to ¬
{index:3, sort direction:normal, width:120, visible:true}
end tell
tell column label column
set properties to ¬
{index:6, sort direction:normal, width:72, visible:false}
end tell
tell column version column
set properties to ¬
{index:7, sort direction:normal, width:72, visible:false}
end tell
tell column comment column
set properties to ¬
{index:8, sort direction:normal, width:120, visible:false}
end tell
set sort column to kind
end tell
set current view of the front Finder window to list view
set the current view of the window of every folder of chooseWindowRight to list view
end tell
I appreciate it in advance,
kind regards,
Kell