Skip to content

jparkerweb/clip-to-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‹ Clip-to-File

banner

PowerShell utility that instantly saves your clipboard content to organized files with timestamped names.

Maintained by

eQuill Labs

✨ Features

  • Smart Detection: Automatically detects images and text in your clipboard
  • Instant Save: One command saves clipboard content with zero configuration
  • Organized Output: Files saved with clean timestamps (YYYYMMDD_HHMMSS format)
  • Conflict Resolution: Automatically handles duplicate filenames by appending numbers
  • Configurable: Simple INI-based configuration with sensible defaults
  • Error Handling: Friendly error messages with pause prompts to read before window closes
  • Explorer Integration: Optionally open Windows Explorer with the saved file selected

πŸš€ Quick Start

  1. Download: Clone or download clip-to-file.ps1
  2. Run: Execute the script from PowerShell
    .\clip-to-file.ps1
  3. Done: Your clipboard content is now saved!

πŸ“ How It Works

Image Content

  • Input: Any image copied to clipboard (screenshots, copied images from web, etc.)
  • Output: 20250118_143025.jpg (saved as high-quality JPEG)

Text Content

  • Input: Any text copied to clipboard
  • Output: 20250118_143025.txt (saved as UTF-8 text file)

File Conflicts

If a file with the same timestamp exists, the script automatically appends a number:

  • 20250118_143025.jpg
  • 20250118_143025_1.jpg
  • 20250118_143025_2.jpg

βš™οΈ Configuration

The script creates a clip-to-file.ini configuration file on first run:

[Settings]
SavePath=C:\Users\YourName\Downloads
OpenFolderAfterSave=false

Configuration Options

Setting Default Description
SavePath Downloads folder Directory where files will be saved
OpenFolderAfterSave false When true, opens Windows Explorer with the saved file selected

Customization: Edit the INI file to change settings

πŸ”₯ Pro Tip: Keyboard Shortcuts

Transform this into a super-powered clipboard tool by mapping it to a keyboard shortcut!

Option 1: AutoHotkey (Recommended)

  1. Install AutoHotkey
  2. Create a script file (e.g., clipboard-hotkey.ahk):
    ; AutoHotkey v2 syntax
    ; Ctrl+Alt+V to save clipboard
    ^!v::Run('powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\path\to\clip-to-file.ps1"')
  3. Run the AutoHotkey script
  4. Enjoy: Press Ctrl+Alt+V to instantly save clipboard content!

Convert to Standalone EXE (Optional)

Make your hotkey portable without requiring AutoHotkey installation:

  1. Right-click your .ahk file
  2. Select "Compile Script" (if you have AutoHotkey installed)
  3. Or use Ahk2Exe compiler directly
  4. Result: A standalone .exe file that runs on any Windows PC

The compiled EXE:

  • Works without AutoHotkey installed
  • Can be added to Windows startup folder
  • Portable - share with colleagues or use on multiple PCs
  • Small file size (~1-2 MB)

Option 2: Windows Shortcut

  1. Right-click clip-to-file.ps1 β†’ "Create shortcut"
  2. Right-click the shortcut β†’ "Properties"
  3. Click in the "Shortcut key" field
  4. Press your desired key combination (e.g., Ctrl+Alt+V)
  5. Click "OK"

πŸ› οΈ Requirements

  • Windows (PowerShell 5.1 or later)
  • .NET Framework (included with Windows)

πŸ“ Usage Examples

# Basic usage
.\clip-to-file.ps1

# Copy an image, then run
.\clip-to-file.ps1
# Output: Image saved to: C:\Users\You\Downloads\20250118_143025.jpg

# Copy some text, then run
.\clip-to-file.ps1
# Output: Text saved to: C:\Users\You\Downloads\20250118_143025.txt

πŸ”§ Troubleshooting

"Execution Policy" Error

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

"Cannot create save directory" Error

  • Check that the configured save path exists and you have write permissions
  • The script will attempt to create the directory if it doesn't exist

"Clipboard is empty" Error

  • Ensure you have content copied to your clipboard before running the script
  • Only images and text content are supported

Error Messages Stay Visible

  • Error messages windows are not automatically closed
  • This ensures you can read error messages when running from shortcuts or double-clicking

🎯 Perfect For

  • Screenshots: Instantly save screenshots with organized naming
  • Code Snippets: Quickly save copied code to timestamped files
  • Research: Save copied text and images during web browsing
  • Documentation: Organize clipboard content for later reference

πŸ“„ License

Free to use, modify, and distribute. No attribution required.


Made for productivity enthusiasts πŸš€

About

πŸ“‹ PowerShell utility that instantly saves your clipboard content to organized files with timestamped names

Topics

Resources

Stars

Watchers

Forks

Contributors