Home > XModules >

Requirements

  • OS X 10.9 or later
    • Developed and tested on macOS 10.14.6

Download

Version 3.2.1 -- 2020-04-29

Old Versions

FileSorter

FileSorter is an AppleScript library to sort a list of files and folders according to the order arranged in Finder. This library help to utilize Finder as a user interface for customizing sorting order of a file list.

The sorting method is automatically changed depending on a kind of a Finder window of icon view, list view and column view.

use FileSorter : script "FileSorter"

(make FileSorter)'s sorted_items()
use scripting additions
use FileSorter : script "FileSorter"

script SorterDelegate
on resolve_container()
return path to home folder as alias
end resolve_container

on target_items_at(a_location)
tell application "Finder"
set a_list to every folder of a_location
end tell

repeat with an_item in a_list
set contents of an_item to an_item as alias
end repeat
return a_list
end target_items_at

on is_rowwise_for_iconview(view_options)
return true
end is_rowwise_for_iconview
end script

FileSorter's make_with_delegate(SorterDelegate)'s sorted_items()

History

  • 3.2.1 -- 2020-04-29
    • Fixed : sorting orders for modification date or creation date are reversed.
  • 3.2 -- 2020-01-31
    • OS X 10.9 or later is required.
    • Removed dependency of ModuleLoader
    • OpenHelpBook.scptd is used to display a help book instead of HelpBook.osax.
  • 3.1.6 -- 2016-09-15
    • Fixed compatibility with ModuleLoader 3.0
    • Updated the help book bundle structure.
      • Mac OS X 10.6 or later is required.
  • 3.1.5 -- 2016-02-02
    • When the returned value of resolve_container() of a delegate object is missgi value, Finder's insertion location will be reffered.
  • 3.1.4 -- 2013-11-15
    • Improved implementation/
  • 3.1.3 -- 2013-05-23
    • Support XList 1.6.
  • 3.1.2 -- 2011-06-14
    • Fixed error with Cover Flow View.
  • 3.1.1 -- 2010-11-14
    • Improved compatibilty with Mac OS X 10.4.
      • When "target_items_at" returns a list of HFS pathes, sorted_items will return a list of HFS pathes instead of a list of aliases.
  • 3.1 -- 2010-10-22
    • ModuleLoader 2.1 is required.
    • Remove a dependency on ShowHelpBook.
    • Fixed an error when Finder's front window is in search mode.
      • When front Finder window is in search mode, resolve_container will return a reference to the Finder window.
  • 3.0.4 -- 2009-11-06
    • Fixed an error when Finder window's view is not arranged icon view.
    • If passed file list is a list of HFS paths, the result is a list of paths instead of a list of aliases.
  • 3.0.3 -- 2009-08-11
    • Fixed an error when the delegate's target_item_at returns missing value and reference Finder's view is list view.
  • 3.0.2 -- 2009-07-28
    • Fixed a problem that when delegate's target_items_at returns a list of HFS paths, getting icon positions are failed.
    • Fixed a problem that when delegate's target_items_at returns missing value, error occurs for list view or column view.
  • 3.0.1 -- 2009-04-14
    • Fixed sorting orders for modification date or creation date are reversed.
  • 3.0 -- 2008.02.05
    • First release with English documents.