FinderSelection is an AppleScriptLibrary to obtain items meeting specified conditions from selected items in Finder.
By using FinderSelection, following complex sequence can be easily performed with several lines.
Actual sequence of code is as follows.
The following script is a sample to obtain text files and PDF files from Finder's selection.
Generate an instance depending on kind of items you want from Finder's selection
Genegate an instance to obtain all of selected files and folders in Finder.
Generate an instance to pick up files from selection in Finder.
Generate an instance to pick up documents from selection in Finder.
Generate an instance to pick up applications from selection in Finder.
Generate an instance to pick up packages from selection in Finder.
Generate an instance to pick up disks or folders from selection in Finder.
Generate an instance to pick up folders from selection in Finder.
Generate an instance to pick up disks from selection in Finder.
Obtain Finder's selection as a list.
Return whether an item returned by get_selection is Finder's insertion location or not.
You can customize behaivior of an instance of FinderSlection.Following three mehods will be frequently used.
set UTIs or file types of items you want.
Set path extensions of items you want.
Set a message to displayed in open panel.
Whether open panel will be opened or not when threre are not items matched with the conditions in selection in Finder.
Whether insertion location is obtained as a selected item or not, when no items are selected in Finder.
If my self(a script or an application running FinderSelection) is selected in Finder, whether my selft is treated as a member of selection or not.
Whether original of alias is searched for or not.
The default location of the open panel which is displayed when no items are selected in Finder.
Change settings of kinds of file and folder to find for instance.Usually these methods are not required, because these methods are called in constructor methods.
These methods are useful to change settings of an instastance after generating an instance.
Make all files and folders targets.
Make only files targets.
Make only document files targets.
Make only applications targets.
Make only packages targets.
Make containers (disks and folders) targets.
Make only folders targets.
Make only disks targets.
Whether the passed item is identical to the result of "e;path to me"e; or "e;path to current application"e;.