Execute Python files directly from the macOS menu bar with ease.
- Integrate seamlessly with macOS menu bar.
- Dynamic listing of Python files in a specified directory.
- One-click file execution.
- Built using the AppKit library.
Make sure to install the PyObjC
package to access the AppKit framework. You can install it using pip:
pip install pyobjc
- Place your Python files in the
./new
directory. - Run the
pyRunner
script. - A menu bar item labeled "File Runner" will appear.
- Click on the menu bar item to see a list of Python files.
- Select a file from the dropdown to execute it.
In the ./new
directory, you will find an example named "slowType". This is a Python implementation that simulates human-like typing. For more details and source code, visit the GitHub repository.
The pyRunner
is an evolution of the original fileLinker project which is also developed by the same author (robbiebusinessacc).
MacOSMenuBar
: Main class handling the macOS menu bar interaction.__init__
: Initializes the menu bar item and its dropdown.fileLinker
: Adds Python files from the./new
directory to the dropdown.runPythonFile_
: Handles the file execution.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Always ensure that the Python files in the ./new
directory are safe to run, as they will be executed as-is.