Sample Header Ad - 728x90

Script to group and sort folder contents

1 vote
1 answer
260 views
I'm trying to make a button on finders toolbar that will group the open folders items by kind and sort by name. I found a script online that ive modified that appears to do this, t stops after changing to icon view and doesnt appear to do anything else. tell application "Finder" activate tell the front Finder window set the current view to icon view set the toolbar visible to true end tell tell icon view options of front Finder window set properties to {sort column:name column, sort direction:normal, text size:12, uses relative dates:true, calculates folder sizes:true, shows icon preview:true} end tell tell application "System Events" to tell process "Finder" tell menu item "Show View Options" of menu of menu bar item "View" of menu bar 1 to if exists then click tell checkbox "Always open in icon view" of window 1 to if (exists) and value is 0 then click tell checkbox "Always open in list view" of window 1 to if (exists) and value is 1 then click tell checkbox "Date Modified" of group 1 of window 1 to if (exists) and value is 1 then click tell checkbox "Date Created" of group 1 of window 1 to if (exists) and value is 1 then click tell checkbox "Size" of group 1 of window 1 to if (exists) and value is 1 then click tell checkbox "Kind" of group 1 of window 1 to if (exists) and value is 0 then click tell checkbox "Version" of group 1 of window 1 to if v(exists) and alue is 1 then click tell checkbox "Comments" of group 1 of window 1 to if (exists) and value is 1 then click tell checkbox "Label" of group 1 of window 1 to if (exists) and value is 1 then click end tell end tell
Asked by SUBZ3RO (127 rep)
Nov 17, 2022, 05:03 AM
Last activity: Aug 3, 2025, 06:04 PM