Sunday, July 5, 2020

#1 2020-05-13 02:35:18 pm

sebrady
Member
Registered: 2005-09-13
Posts: 36

sort folder by modification date

I need to sort a folder by modification date. Here is what I have but does not work

Applescript:

tell application "Finder" to tell Finder window 1
   
   tell its list view options
       set sort column to column modification date
   end tell
   
   set currentFolder to target
   close
   open currentFolder
   
end tell

Offline

 

#2 2020-05-13 02:47:02 pm

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 532

Re: sort folder by modification date

This works under Catalina. The only change I made to your script was to add column after modification date.

Applescript:

tell application "Finder" to tell Finder window 1
   
   tell its list view options
       set sort column to column modification date column
       -- set sort column to column id modification date column -- alternative if above doesn't work.
   end tell
   
   set currentFolder to target
   close
   open currentFolder
   
end tell

BTW, you may want to look at KniazidisR's helpful response to your following thread--it contains  useful information on this topic.

https://macscripter.net/viewtopic.php?id=47645

Last edited by peavine (2020-05-13 03:48:40 pm)


2018 Mac mini - macOS Catalina

Offline

 

#3 2020-05-14 04:52:04 am

sebrady
Member
Registered: 2005-09-13
Posts: 36

Re: sort folder by modification date

thank you, can't thank you enough.  I do audio editing for TV. Its not the high tech audio magic I do, its all about the files and folders. Applescript does so much for me so I practically do not have to click. Thanks again. Have a blessed day.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)