Skip to main content

Get selected files from macOS Finder.

Project description

findersel

Get selected files from macOS Finder and use them programatically within your Python program.

Installation

$ pip install findersel

Usage

Select some files on Finder:

Finder screenshot

And get the selected files:

>>> import findersel

>>> list(findersel.get_selected_files())
['/Users/sdelquin/findersel/LICENSE',
 '/Users/sdelquin/findersel/Makefile',
 '/Users/sdelquin/findersel/README.md',
 '/Users/sdelquin/findersel/requirements.txt',
 '/Users/sdelquin/findersel/setup.cfg',
 '/Users/sdelquin/findersel/setup.py']

Note than the function returns a generator.

You can get the selected files ordered by name with:

>>> import findersel

>>> list(findersel.get_selected_files(sort=True))
['/Users/sdelquin/findersel/Makefile',
 '/Users/sdelquin/findersel/README.md',
 '/Users/sdelquin/findersel/requirements.txt',
 '/Users/sdelquin/findersel/setup.cfg',
 '/Users/sdelquin/findersel/setup.py',
 '/Users/sdelquin/findersel/LICENSE']

Changelog

0.1.4 15/02/2023
  • Fix documentation.
0.1.3 15/02/2023
  • Add parameter to sort files.
0.1.2 20/06/2021
  • Get rid of prettyconf external dependency.
0.1.1 20/06/2021
  • Add documentation.
  • Fix bug when no files are selected.
0.1.0 20/06/2021
  • Add initial code.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

findersel-0.1.4.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

findersel-0.1.4-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page