Applescripts not working in Finder since Mavericks

Solution 1:

This looks like a bug. I've tried rewriting the script various ways but the change only seems to take effect for new windows.

So here is a horribly hacky way to get this to work.

tell application "Finder"
    tell list view options of window 1
        tell column kind column
            if sort direction is normal then
                set sort direction to reversed
            else
                set sort direction to normal
            end if
        end tell
        set sort column to kind column
    end tell
    set currentPosition to position of window 1
    set currentTarget to target of window 1
    make new Finder window to currentTarget
    set position of window 1 to currentPosition
    close window 2
end tell