4

paste-file

Save the content of your clipboard directly to a file.

paste-file is a handy Python script that simplifies the task of saving clipboard content to a file. Whether you need to store information copied from different sources or want a quick backup of your clipboard data, this script has got you covered. Specifically designed for MacOS users, it utilizes AppleScript to seamlessly interact with Finder for path retrieval and dialog display.

To get started, make sure you have the necessary Python libraries installed. You can easily install them by running the following command:

pip install -r requirements.txt

Once the dependencies are installed, you can execute the script from the terminal using the following command:

python3 paste-file.py [-ph/--paste-here] [-f/--folder <folder_name>]

The script supports the following arguments:

  • -ph or --paste-here: This flag allows the script to save the clipboard content to a file in the current directory without displaying a dialog box. Instead, you can directly enter the file name in the terminal.

  • -f or --folder <folder_name>: This optional argument enables you to specify a subfolder in the current working directory where the file will be saved. If the specified folder doesn't exist, it will be created.

If no arguments are provided, the script will display a dialog box asking for the file name and save the clipboard content in the directory of the active Finder window. If there are no open Finder windows, the file will be saved on the desktop.

Give paste-file a try and streamline your clipboard management workflow today! For more details and to access the source code, visit the paste-file GitHub repository.