Paste Swiftly is an open-source macOS utility that lives in your menu bar and allows you to quickly insert email aliases into any application via the macOS Services menu.
While the official website covers the user-facing features, this README is intended for developers who want to understand how the app works, build it from source, or contribute.
Paste Swiftly is built purely in Swift using AppKit. It avoids bloated web frameworks (like Electron) to ensure it uses virtually zero background resources and stays completely native to macOS.
- macOS Services Menu Integration: The app bridges into the macOS ecosystem by registering an
NSServicesprovider. When you right-click in another app and choose "Paste Swiftly", the system invokes theshowEmailPickerFromServicemethod inServiceProvider.swift. - Floating Contextual Menus: Instead of bringing up a heavy window, the app calculates the mouse cursor's current position and programmatically constructs an
NSMenu. It pops up a native dropdown that doesn't steal window focus from your active application. - NSPasteboard Automation: Once an email is selected, Paste Swiftly handles the complexities of
NSPasteboardand simulates the standardCmd+Vkeystroke (via AppleScript/Carbon events) to instantly paste the selected text directly into the previous app. - Data Storage: Email aliases and settings are securely stored locally using standard
UserDefaults, ensuring they never leave your device. - macOS Contacts (MeCard) Integration: The app optionally interfaces with the system's Contacts framework to pull emails from the user's personal "Me" card, allowing instant setup without typing anything.
If you download the pre-compiled .dmg from the Releases page, you may see a warning that says:
"Paste Swiftly" Not Opened. Apple could not verify "Paste Swiftly" is free of malware...
Because the app is built without a paid Apple Developer certificate (Notarization), Gatekeeper blocks it by default. To bypass this:
- Open your Applications folder.
- Right-click (or Control-click) on
Paste Swiftly.app. - Select Open from the context menu.
- Click Open on the prompt. You only need to do this once.
- macOS 13.0 (Ventura) or later.
- Xcode 14.0 or later (for building from source).
- Clone the repository:
git clone https://github.com/k79639/Paste-Swiftly.git cd Paste-Swiftly - Open the project in Xcode:
open "Paste Swiftly.xcodeproj" - Ensure your signing team is set correctly in the project settings if you wish to run it on a physical device or distribute it.
- Select the Paste Swiftly scheme and build/run (Cmd + R).
AppDelegate.swift: Manages the application lifecycle, sets up the menu bar item (NSStatusItem), and registers the Services provider.ServiceProvider.swift: The core of the context menu integration. Listens for the macOS service call and triggers the floating picker.EmailStore.swift: A singleton that manages fetching emails from local storage and the system Contacts app.MeCardSource.swift: Handles theContactsframework integration to read the user's "Me" card.SettingsWindowController.swift: The native AppKit window for adding/removing aliases manually.
Paste Swiftly is entirely local. It has no networking components, no telemetry, and requires no internet access to function. The App Sandbox configuration limits it solely to the resources it needs.
Contributions are welcome! If you have ideas for improvements, bug fixes, or new features:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/MyFeature). - Commit your changes.
- Push to the branch (
git push origin feature/MyFeature). - Open a Pull Request.
Please ensure your Swift code follows standard Swift style guidelines and maintains the lightweight, fast nature of the app.
This project is licensed under the MIT License. See the LICENSE file for details.