yoink

Yoink v3.6.5 re-introduces its clipboard history feature and the accompanying widget.
Here are a few details about its implementation for macOS Big Sur and newer.

The No-Button-Action Conundrum

Widgets on macOS Big Sur and up (and iOS, for that matter) can’t really react to a user’s click on them by themselves, so you cannot run any logic from a user’s input.
A click onto a widget will always bring you back to its containing app, where you can then run logic accordingly.
On iOS, that’s obvious, as it’ll open up the owning app and put it front and center.
On macOS, that can be a little more subtle, because macOS allows apps to run in the background (like Yoink does, mostly).

When you click on an item in Yoink’s widget, it’ll tell Yoink to run the logic to copy the clicked item (or pin it, or add it to Yoink, or reveal it in the browser, depending on the modifier key you pressed during the click).

But there’s a problem with that in the case of Yoink:

The Foreground Conundrum

No matter where you click on a widget (either the background of it, or a SwiftUI Link() object), it will bring its containing/owning app to the foreground.
For many apps, that will be fine. But Yoink is an app that runs in the background and only very rarely needs to actually become the active, keyboard-input-accepting app.

So I thought, perhaps I can have another application inside Yoink’s app bundle, which is LSBackgroundOnly, with a custom URL scheme that would be called from the widget using a SwiftUI Link() object. An app that has LSBackgroundOnly set to YES in its Info.plist cannot present any user interface, and cannot become “key”, even if the system tells it to.
But there’s another roadblock – even though only the secondary app inside Yoink’s app bundle should be able to open the custom URL scheme, the widget will send that Link() to its containing/owning app only, no matter the url scheme. In this case, the main Yoink app.

The point of the widget is to quickly re-copy something and then paste it somewhere right away.
Say you're editing text in TextEdit, then open the widget, click on it to re-copy something and then press command-v to paste it into TextEdit only to hear a beep because the app isn't active anymore (because Yoink is). So you have to click into the TextEdit document to make it active, and only then can you paste. That can (and will) become annoying very quickly.

In order to have Yoink never become the active app from a click on its widget, I’d have to move the widget plugin/appex bundle out of the Yoink app bundle’s PlugIns folder, into the secondary target one’s.
Only that way would the widget attempt to make the secondary target(and thus, not Yoink) frontmost – and fail because of LSBackgroundOnly, leaving the currently frontmost app active – and send the custom URL scheme link to it. The secondary target would then forward the link to the main Yoink app bundle.

Tada, it works. But that lead to yet another problem. (When did “it just works” turn into “it just won’t”? And while I’m at it, what’s with those widgets? They feel quite… neutered to me compared to what they were able to do before.)

The Widget Recognition Conundrum

So far, I managed to have Yoink not become active when an item in the widget is clicked.
But now, with the Yoink app containing the secondary target containing the widget, macOS was unwilling to recognize and show the widget in Notification Centre.
Interestingly, a double-click onto the secondary target in Finder would make it show right away.
Infuriatingly, launching the secondary target quietly from within Yoink at launch won’t – and I had a lot of different approaches:
– Launching the secondary app directly with NSWorkspace’s -launchApplicationAtURL:…
– Launching the secondary app via its URL scheme
– Having Finder open the secondary app
– Running an NSTask open -a <secondaryapp> /path/to/somefile
– Registering the app using LSRegisterURL

None of it worked. I figured, the problem was that it was Yoink launching the secondary app, not the “system” or “user”, like it was the case when double-clicking it in Finder.

Which made me think of login item helper apps.
Inside the macOS app sandbox, an app cannot set itself as a login item. It needs to have another “helper” app inside its Library/LoginItems folder which it designates as a login item, and that app will then in turn launch the containing app. Nuts, but there it is.

The point is, the system launches those login item helper apps, not the containing app.

Heureka. In Yoink, at launch, I set my secondary app, which contains the widget bundle, as a login item with SMLoginItemSetEnabled, causing the system to launch it. Now, finally, Notification Centre recognizes and shows Yoink’s widget.

What a needless journey.

Read more

alternate clickbaity title: the update I learned Swift and SwiftUI for.

I’m happy to announce Yoink for Mac v3.6.5’s immediate availability.
In addition to numerous quality-of-life improvements and adjustments, this update re-introduces the (judging from the inquiries I received about it) beloved Clipboard History feature, and its widget.

What’s Yoink?

Yoink offers you a temporary place (a “shelf”) for files you drag from Finder, or app-content like images from websites. It frees your hand and mouse cursor to let you more easily and quickly navigate to the destination of your files.

Yoink automatically appears at the edge of your screen when you start a drag a file, allowing you to place it there.

What’s New in Yoink v3.6.5?

Let’s talk about the most important thing first – the resurrected clipboard history and its widget.
Up until earlier this year, I had virtually no experience with Swift, let alone SwiftUI, and I was pretty happy to continue with my Objective-anCient ways.
But I realized it held me back. Things are clearly moving away from Objective-C and towards Swift, so at the beginning of this year (2022), I made a point of learning the basics of Swift as quickly as possible to have the option of using everything Apple’s platforms and APIs have to offer.

With macOS Big Sur, Apple got rid of its old-style Today Widgets (which could be written in Objective-C and a nice .xib-interface file) and brought over the new SwiftUI-style widgets from iOS. That’s why Yoink’s widget had been defunct for so long – I didn’t have the skills to replace it.

But enough chit-chat, here’s the nitty-gritty!

While the clipboard history recording still happens in Yoink itself in the background, the widget provides quick access to previous copies.
It comes in two sizes: medium and large.
The medium widget shows up to 6 copied objects, the large one up to 12.

Widget Configurability

That doesn’t sound like a lot, but you can have multiple widgets, and they can be configured to show
1) the most recent copies (medium: 1-6, large: 1-12)
2) older copies (medium: 7-12, large: 13-24)
3) oldest copies (medium: 13-18, large: 25-36)

So you can, for example, have one large and one medium widget to show the last 18 copied items, or three large widgets to show the last 36 copied items.

Apart from that, you can have the widget show only particular data types:

1) Only copied images
2) Only copied text
3) Only copied links
4) Only copied files
5) All copied items
6) Only pinned copies (pinning copied items is new in Yoink v3.6.5)

That allows the widget to be very flexible and useful.

How to use the Widget (Widget Clicks and Tricks)

– Click on an item in the widget, and it is copied to your clipboard
– Option(⌥)-click on an item, and it gets sent to Yoink so you can drag it out at a later time
– Shift(⇧)-click on an item, and it gets pinned (new in v3.6.5)
– Command(⌘)-click on an item, and it is revealed in the Clipboard History Browser (new in v3.6.5)

Pinning Items (new in v3.6.5)
A pinned item in the widget

When the Clipboard History reaches its threshold (up to 36 items), it will begin clearing out the oldest copies to make place for new ones.
In some cases, you might want to hold on to items indefinitely. That’s why you can now pin them. A pinned item will not be cleared out, unless you unpin it or delete it manually.

Clipboard History Browser (new in v3.6.5)

The history browser gives you a simple way to organize your copied items. Pin, unpin, delete, send to Yoink, copy, or clear out the entire history.

If you’d like to learn more about some of the implementation details behind this new widget, here’s a blog post for you.

What else is new in Yoink v3.6.5?

– It raises the minimum system requirements from macOS 10.10 Yosemite to macOS 10.12 Sierra.
– Instead of a TIFF file, a PNG file is created when pasting image data into Yoink.
In that vain, Yoink also transparently provides PNG and JPEG data when dragging out images of the types HEIC, HEIF or TIFF to broaden compatibility with other apps.
– It also fixes a couple of bugs and improves compatibility with, among other apps, DEVONthink, where items dragged from DEVONthink to Yoink and then out of Yoink are no longer moved, but copied, to ensure the integrity of DEVONthink’s files database.

What do I need to use Yoink for Mac?

Yoink runs natively on Apple Silicon and Intel Macs, and requires macOS Sierra 10.12 or newer.
It’s localized in English, German, French, Italian, Simplified Chinese, Japanese, Korean and Portuguese.

Where can I get Yoink?

Free Demo (direct download, ~28 MB, 30 days, notarized by Apple)
Mac App Store ($7.99, one-time purchase, no in-app purchases, update free for existing customers, as it’s been the case since v1.0)
Mac Productivity Bundle (Mac App Store, 25% off Yoink, Transloader and ScreenFloat)
Setapp (subscription service with over 200 Mac apps)

Yoink is also available for iPad and iPhone

For members of the press or anyone else who is interested, here’s a press kit.

I hope you like the update. If you have any feedback or questions, please do not hesitate to write me – I’m looking forward to hearing from you.

Enjoy 😊

Read more

Yoink for iPad and iPhone v2.3.5 introduced Background Clipboard Monitoring, which, if enabled, stores anything you copy, even if Yoink itself is in the background, effectively giving you a clipboard history.

With version 2.4, I’ve improved it by adding the ability to only monitor for specific data types, and to temporarily pause the monitor.

Background Clipboard Monitoring in Action on iOS 15 and iPadOS 15
Captured on my iPad using iPadOS 15, lightly edited for brevity but otherwise unaltered

For demonstrative purposes, I kept Yoink in the foreground as a Slide-Over app, just to show what gets added when.
But all of this works even if Yoink is not visible on your display and put in the background.

In the video above, I enable Yoink’s clipboard monitor and consecutively copy an image, a link, and some text; all get stored in Yoink.
I then use the Picture-in-Picture’s fast forward button to tell Yoink to only watch for text. With that option set, I again copy an image, a link, and some text; this time only the text is stored in Yoink.
I click the fast forward button again to make Yoink only save links, and repeat the copy-procedure of an image, a link, and some text; now, only the link gets stored in Yoink.
A final time I click the fast forward button to have Yoink only watch for images and – you guessed it – when I copy an image, a link and some text, only the image is added to Yoink.

Next, I pause the clipboard monitor by using Picture-in-Picture’s Pause button. Now, Yoink does not react to any copy events at all. By pressing the Play button in PiP, I reactivate the clipboard monitor.

Notes on the monitor’s behavior

The clipboard monitor attempts to ignore sensitive data, like passwords. For this, it refers to the pasteboard data types proposed at nspasteboard.org, and checks if there are any password-type app names contained in the pasteboard data types, like “1password”, or “keychain”, for example. If encountered, Yoink ignores the copy-event and waits for the next.

As for energy consumption, it is very light-weight.
The images you see in Picture-in-Picture are static – it doesn’t play video, it doesn’t play audio.
Yes, Yoink will continue running in the background because of this, but all it does is check your pasteboard every couple of seconds (and not even the data directly, only a “changeCount” value provided by the API).
If a change has occurred, it will save the content to Yoink and to disk.
Syncing – if enabled – only occurs when the app comes back to the foreground, so there is no added network activity.

Other Changes in Yoink v2.4

– I improved Yoink’s compatibility with GarageBand. Dragging an audio file to GarageBand from Yoink now works correctly
– Picture-in-Picture for arbitrary content now properly displays Map location items
– I fixed a memory leak and a couple of app crashes

Pricing and Availability

Yoink is available on the iOS App Store as a one-time purchase, for $5.99 / €5.99.
It is localized in English, German, Simplified Chinese, Japanese and Korean, with more languages to follow.

Links

Yoink for iPad and iPhone Website
Yoink on the iOS App Store
Yoink for iOS Usage Tips
Yoink for iOS Press Kit (.zip download)

Yoink is also available for Mac:
Yoink for Mac Website
Yoink on the Mac App Store
Yoink for Mac Usage Tips
Yoink for Mac Press Kit (.zip download)

I do hope you enjoy Yoink!
If you have any feedback or questions, don’t hesitate to mail me, I’d love to hear from you.

Stay healthy and safe!

Read more

After releasing Yoink v2.3, which brought the app up-to-speed on all things iOS 15, I have another great update out for Yoink for iPad and iPhone, which allows you to make the app monitor your clipboard in the background and save almost anything you copy or cut.

Background Clipboard Monitoring

In the video above, you can see it in action, running on my iPad.
Starting the Clipboard Monitor offers you three options:
1. a 5-minute timeout
2. a 30-minute timeout, or
3. no timeout at all.

So, were you to start clipboard monitoring with a 5-minute timeout, it would save anything you copy or cut, and automatically end after 5 minutes, if you didn’t copy or cut anything in that time.
Clipboard monitoring also ends as soon as you close the Picture-in-Picture overlay.

Of course, this also works on iPhone:

So in addition to sharing content to Yoink with its Share extension, manually pasting content into the app, and Siri Shortcuts, you can now have anything you copy stored automatically in Yoink.

Notes on the monitor’s behavior

Yoink attempts to *not* save sensitive data, like passwords. It does so by referring to the pasteboard data types proposed at nspasteboard.org. It also checks if there are any common password-type app names contained in the pasteboard data types, like “1password”, or “keychain”, for example. If that’s the case, Yoink ignores the copy/cut event and waits for the next.

Regarding energy consumption, it’s very light-weight.
The Picture-in-Picture content is just a static image that changes to another static image if a copy-event was detected. It doesn’t play video, it doesn’t play audio.
Yes, Yoink will continue running in the background because of this, but all it does is check your pasteboard every couple of seconds (and not even the data directly, only a “changeCount” value provided by the API).
If a change has occurred, it will save the content to Yoink and to disk.
Syncing only occurs when the app comes back to the foreground, if enabled, so there are no round-trips to iCloud every time you copy something.

Another (already released) cool new feature in Yoink for i(Pad)OS 15

Just because I think it’s awesome, I thought I’d mention another Picture-in-Picture feature Yoink has been offering since iOS 15 was released – displaying arbitrary content in PiP.
This means you can view photos, texts, PDFs, eMails, websites and more in the Picture-in-Picture overlay.
Check out this video of it, where I open a website in PiP and scroll through it using its controls.

Links

Yoink for iPad and iPhone Website
Yoink on the iOS App Store
Yoink for iOS Usage Tips
Yoink for iOS Press Kit (.zip download)

Yoink is also available for Mac:
Yoink for Mac Website
Yoink on the Mac App Store
Yoink for Mac Usage Tips
Yoink for Mac Press Kit (.zip download)

I hope you enjoy Yoink’s recent updates. If you have any feedback or questions, don’t hesitate to mail me, I’d love to hear it!

Stay healthy and safe!

Read more