FinderSelection
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.
- Obtain Finder's selection filterd with conditions of specified kind, file type or path extension.
- If items matched with the conditions did not exist, a panel to select files will be opened.
- In the case of you script is an applet or a droplet and the application is launched with double clicking in Finder, a panel to select files will be opened.
- If alias files are included in selected items, the originals are checked with the conditions.
- The behaivior can be changed to prevent following originals at setting.
use FinderSelection : script "FinderSelection"
tell FinderSelection's make_for_file()
set_prompt_message("Choose text file or PDF file.")
set_types({"com.apple.traditional-mac-plain-text", "TEXT", "PDF "})
set_extensions({".txt", ".pdf"})
get_selection()
end tell
History
- 2.1.1 -- 2020-01-30
- Added English documents.
- Use OpenHelpBook.scptd instead of HelpBook.osax.