https://github.com/itsbrex/paste-file
A Python script to quickly save the content of your clipboard directly to a file with option to save in frontmost Finder window folder.
https://github.com/itsbrex/paste-file
clipboard macos productivity python
Last synced: 3 months ago
JSON representation
A Python script to quickly save the content of your clipboard directly to a file with option to save in frontmost Finder window folder.
- Host: GitHub
- URL: https://github.com/itsbrex/paste-file
- Owner: itsbrex
- License: mit
- Created: 2023-04-21T06:39:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T20:50:05.000Z (11 months ago)
- Last Synced: 2025-02-19T22:11:58.322Z (3 months ago)
- Topics: clipboard, macos, productivity, python
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# paste-file
`paste-file` is a Python script that allows you to save the content of your clipboard directly to a file. This can be useful for storing information copied from different sources or for quickly backing up data currently stored in your clipboard.
This script is designed with MacOS users in mind and uses AppleScript to interact with Finder for path retrieval and dialog display.
## Installation
The script depends on several Python libraries. You can install them using pip:
```shell
python -m pip install -r requirements.txt
```## Usage
You can run the script from the terminal as follows:
```shell
python paste-file.py [-ph/--paste-here] [-f/--folder ]
```### Arguments
- `-ph` or `--paste-here`: This flag will make the script save the clipboard content to a file in the terminal's current directory without popping up a dialog box. The script will instead ask you to enter the file name directly into the terminal.
- `-f` or `--folder `: This optional argument allows you to specify a subfolder in the current working directory (CWD) where the file will be saved. If the specified folder doesn't exist, it will be created.
If no arguments are given, the script will pop up a dialog box asking for the file name and will save the clipboard content in the currently active Finder window's directory. If no Finder windows are open, it will save the file on the desktop.
The script will then print the relative path of the saved file and open it in your default editor.
- `-ph` or `--paste-here`: This flag will make the script save the clipboard content to a file in the terminal's current directory without popping up a dialog box. The script will instead ask you to enter the file name directly into the terminal.
- `-f` or `--folder `: This optional argument allows you to specify a subfolder in the current working directory (CWD) where the file will be saved. If the specified folder doesn't exist, it will be created.
If no arguments are given, the script will pop up a dialog box asking for the file name and will save the clipboard content in the currently active Finder window's directory. If no Finder windows are open, it will save the file on the desktop.
## Contributors
Contributions are welcomed. This project follows the all-contributors spec. ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)):
[](#contributors)
## License
MIT © [itsbrex](https://github.com/itsbrex)
If you found this project interesting, please consider [sponsoring me](https://github.com/sponsors/itsbrex) or following me on twitter
![]()