2

I can't get this reversed thing to work:

Tell application "Finder" to set the sort direction of the modification date column to reversed
  • Welcome to Ask Different. For tips on asking great questions, please visit the FAQ. In this case, please give us a little more information on what you're trying to do, and what your results look like now. The Applescript Language Guide may also be of assistance in the meantime. – MattDMo Mar 11 '13 at 17:49
  • 1
    I try to change view settings of front most window in Finder. I can't figure out how to change modification date column to reversed order. – Johnnie Mar 11 '13 at 18:34
4

There is a bug in 10.7 and 10.8 where changing the sort direction doesn't always work unless you change the sort column first (see this question).

tell application "Finder" to tell list view options of window 1
    set sort column to name column
    set sort column to modification date column
    set sort direction of column modification date column to reversed
end tell
2

There are some useful links in the answers to this question. I would recommend using the Accessibility Inspector, which is part of XCode, to find the names of the various elements you are trying to address with your script. You can also try some of the scripts linked here, in particular the first one (edited slightly):

set appname to "Finder"

set winstuff to "defaultval"
set menustuff to "defaultval"

tell application appname
  activate
end tell

tell application "System Events"
  tell process appname
    set winstuff to entire contents of front window
    set menustuff to entire contents of menu bar 1
  end tell
end tell
--return winstuff & "rrrr" & menustuff -- comment this out to get just winstuff
return winstuff -- comment this out too to get just menustuff
--return menustuff

Unfortunately I'm not in front of a Mac right now, but from these tools you should be able to find out the element to address.

-1

I think i found another bug. This code does not make kind column invisible.

tell application "Finder" to set visible of column id kind column of list view options of front window to false

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .