Synopsis|FileSorter Reference

Usage

The basic sample of FileSorter is as follows. The following sample obtain Finder's insertion location and sort all of item in it according to its view style.

use FileSorter : script "FileSorter"

(make FileSorter)'s sorted_items()

By giving a delegate to the instance, following behavior can be customized.

The following sample shows the usage of delegate.

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()
Synopsis|FileSorter Reference