PasteFlow V2: A Big Update to my Favorite Paste Stack
How I learned to copy files to the clipboard using only their paths. A journey that led to an exciting update! If you are an Alfred user, you can now do so much with this utility.
Hey guys, this is Robert!
This newsletter is a bit different from my usual ones because I want to share something that completely took over my week. It might get a little technical, but don't worry - I mainly want to tell you a backstory to this workflow I'm sharing today.
About a week ago, I thought I was so close to releasing an update to PasteFlow - that Alfred workflow I created as a paste stack that helps you grab text items and pin them for later use. If this is your first time hearing about it, you can check this video where I introduced it.
In my previous newsletter I was really pumped to share with you that I was close to adding file support to this workflow. By that time I had already spent about a week working on this update and thought I was close to done. Originally, PasteFlow only worked with plain text because I thought that's all Alfred's clipboard history could handle. But after diving deeper, I discovered a way to access file paths directly from Alfred's database! Now, I knew absolutely nothing about databases before this (and to tell you the truth, I still don't!). But with AI's help, I managed to figure out how to do this.
When I made that discovery, I thought I was almost there. Getting the items onto the actual paste stack? Easy peasy. Solved that with AI after some trial and error. But then came the real challenge - putting those file paths back on the user's clipboard so they could be pasted anywhere. Sounds simple, right? Nope. Placing something on the clipboard so it can be pasted on Finder is easy, but how about being able to paste a PDF in Bear, or in an email as an attachment, or another file in Photoshop as an image...
You guys have no idea - it took me DAYS of researching, thinking I had the solution, trying again, completely changing the code, searching every website, every forum, and every related thread I could find. It was one of those times where I questioned all my life choices and wondered if I'd missed my true calling as a developer. Nothing seemed to do the trick. Until finally, I started digging into the Alfred community and found this workflow called Rich Snippets. This workflow didn't actually fix it for me (though it taught me how to incorporate the new rich text feature), but Vitor, its creator, shared with me what I had almost gone crazy searching for.
Here's the big secret I discovered (and it feels huge!) - apparently there's this undocumented Apple restriction where only applications can put items back on the user’s clipboard for universal pasting. Not scripts, not terminal commands - it has to go through an actual application. Vitor was kind enough to allow me use a small app he did for this purpose, and this is now included within the PasteFlow workflow. You can check my naive interaction in Alfred's forum, I hope it someday helps someone struggling with my same issue.
Now, after finally figuring this out, I had a few more ideas that I implemented in this big update. While PasteFlow was already pretty good compared to other paste stacks, I honestly think it's now become the absolute best. Sure, I might be biased 😄 but I really believe you'll love what it can do. There are so many ways to use it, and I show some cool examples in the video I'm sharing with this release:
You can download the latest version of PasteFlow here or check out the complete documentation.
I built PasteFlow mainly for myself, but I put a lot of time and heart into making it work great for everyone. If you find it useful in your workflow, I'd be incredibly grateful if you'd buy me a coffee ☕️ - it really means a lot!
If you liked this you may also enjoy some content I have up on my YT Channel! I don’t hang around social media a lot, but when I do I’m on IG or Twitter. You can also check out some of my online classes, listen to my music, or in case you haven’t already, subscribe to my weekly newsletter. Thank you for reading!