Jan
9
2014

Command-C: A Local Clipboard Sharing Tool for OS X and iOS 7

Posted by at

Command-C

Even if my workflow these days primarily consists of reading and writing on the iPad, there are still times when I need to share content – either text or pictures – across my iOS devices, from my iPad to my Mac, or from OS X to iOS. While I can normally achieve inter-device communication using something like Evernote to keep my notes in sync everywhere, it's not an ideal solution: why having to save and sync a temporary bit of text that simply needs to be acted upon once? Command-C, created by Italian developer Danilo Torrisi, is a clipboard sharing tool that I've been testing for the past couple of months and that has allowed me to eschew syncing services when I just want to quickly copy & paste between my Mac and iOS devices.

Clipboard Sharing

If the idea sounds familiar, that's normal. Back in 2009, Tapbots released Pastebot, a utility for OS X and iPhone OS (there was no iPad then) that allowed you to share contents of the clipboard and generic bits of data locally between a Mac and an iPhone. Pastebot was great for its time, but its functionality was deeply hindered by the limitations of Apple's old iPhone software, which put strict limits on how apps could work in the background. Tapbots tried to work around those limitations, but, ultimately, it wasn't worth it. After the launch of iCloud in 2011, other developers picked up on the idea of creating a clipboard sharing tool for iOS and OS X based on automatic cloud sync, relying on iCloud to constantly share whatever you had copied on one device to the other. My problem with those apps was threefold: iCloud wasn't reliable; I didn't want to always send my clipboard to iCloud; and, iOS apps still couldn't always run in the background.

Command-C brings back the old concept of local clipboard sharing, with some unique twists. Thanks to iOS 7, Command-C on an iPhone or iPad (the app is Universal) can always be available as a receiver in the background, using notifications to alert you when the clipboard has been received from another device. Communication between devices (which includes a dedicated menubar app for the Mac) happens on a local WiFi network, it's encrypted, and no data is sent over the Internet; though the app works with a “one tap” approach to send your current clipboard to another device, there are some fantastic tools for power users who want to do more with keyboard shortcuts, URL schemes, and bookmarklets. Command-C is a clipboard sharing tool for the modern age, built with iOS 7 (and a new set of limitations that the current OS entails) and multiple iOS devices in mind.

Command-C

Command-C is available for iOS and OS X, but using the Mac app isn't necessary if all you want to do is sharing the clipboard from an iPhone to an iPad and vice versa. The setup process is fairly straightforward, with the app asking you to have both devices on the same local network and displaying a confirmation dialog to add a device and let instances of Command-C “see” each other. If you also want to add a Mac to the mix, you'll need to deal with the menubar app and confirm iOS devices from there. Once added, devices will be listed with their respective icons and names in the main screen, and you'll be good to go.

To share the current contents of your clipboard, tap a device (on iOS) or double-click it (OS X).1 The clipboard will be sent, showing a notification and playing a sound (both optional settings) on the other device; on the receiver's end, the clipboard will be set automatically to the new one. Command-C makes for an impressive demo: copy something on your iPad, send it, paste it on the iPhone with the standard Copy & Paste menu.

Command-C

What's nice about Command-C is that it's not limited to plain text. Either on iOS or OS X, you can copy rich/formatted text and even images and share them to another device to paste right away. You can copy an image on iOS, send it to your Mac, and paste it in the Finder or any other app; you can select rich text (including formatting with hyperlinks) on a Mac, and paste it on the iPad.2 In my tests, Command-C always preserved formatting/images and allowed me to paste content into apps like Apple Mail, Evernote, the Finder – I was also able to copy an image from my Mac to my iPhone, send it from my iPhone to my iPad, and paste it in Mail as an inline attachment. While AirDrop has somewhat obviated the need for an image sharing tool for iOS devices, I found the possibility to send images to the Mac fast and convenient; unfortunately, you can't send multiple copied images at once, as the clipboard will force the receiver device to only see one at a time.

Command-C

URLs are also well implemented in Command-C. When you send a URL to an iOS device, Command-C can automatically open the URL in Safari: if Command-C is in the foreground, the URL will open automatically, otherwise you'll have to tap on a notification first. Command-C for Mac comes with less limitations here, as the app can always run in the background in the menubar and you don't have to click notification banners to launch your default browser.

Power Users

Danilo Torrisi built some powerful advanced features into the first release of Command-C. As he copiously detailed in the app's FAQ, Command-C has a URL scheme to send your clipboard, send specific text, or send a URL directly to another device with just one tap. You can find the URL scheme documentation here, and Torrisi also created a handy interactive bookmarklet generation webpage to assemble browser boomarklets based on action and device names.

Command-C

To understand the URL scheme, here's an example:

command-c://x-callback-url/copy?deviceName=iPhone

The app has three actions: copy, to send the current clipboard; copyText, to send specific text to copy on another device; copyAndOpenURL, to copy a URL and force it to open in the default browser.

The deviceName parameter indicates the name of the device as picked by Command-C. It needs to be encoded, and you need to pay attention to apostrophes or other special characters in the name. If you don't want to use the name parameter because encoding is boring (and an overall awful procedure), you can use deviceIndexinstead. With the index, 0 will be the first device in the list, 1 the second one, and so forth. However, there is a simpler way to do this, which I'll explain in a tip below.

Keeping in mind that content and names always need to be encoded for the URL scheme, here's my set of Command-C actions to automate the process of sharing the clipboard to other devices.3

Bookmarklets to copy the current browser page to my iPhone/iPad and return to Safari automatically:

javascript:window.location='command-c://x-callback-url/copyText?text='+encodeURIComponent(window.location)+'&x-success='+encodeURIComponent(window.location)+'&x-failure='+encodeURIComponent(window.location)+'&deviceName=iPad';
javascript:window.location='command-c://x-callback-url/copyText?text='+encodeURIComponent(window.location)+'&x-success='+encodeURIComponent(window.location)+'&x-failure='+encodeURIComponent(window.location)+'&deviceName=iPhone';

An Editorial workflow to copy the currently selected text to one of your Command-C devices and return to Editorial (download here).

A Launch Center Pro action to send the clipboard to another device (download here):

command-c://x-callback-url/copy?deviceName=iPad&x-source=Launch%20Pro&x-success={{launchpro://}}

And another one to send text manually to another device with a keyboard prompt (download here):

command-c://x-callback-url/copyText?deviceName=iPad&x-source=Launch%20Pro&x-success={{launchpro://}}&text=[prompt:Paste To iPad]

And a Launch Center Pro workflow to upload a photo to Dropbox, get its URL back, and copy it to a device called “iPad”, which will open the photo's URL in Safari (download here). Note the encoding trick in the second part of the URL.

launch://dropbox/addphoto?attach=photo:cameraroll&path={{/Photos/LCP}}&getlink=1&x-success=command-c%3A%2F%2Fx-callback-url%2Fcopy%3FdeviceName%3DiPad

Note: these URLs were shared across devices using Command-C.

Three tips worth keeping in mind when automating Command-C or chaining it to other apps:

  • Reset your device's name to something simpler like “iPhone” in Settings > General > About > Name; if you had already added a device to Command-C before changing its name, remove the device, force-quit the app, reboot your device, and Command-C will pick up the new device name;
  • If you don't want to use Safari to exchange URLs, remember: Google Chrome has a URL scheme that you can use to open URLs directly in Chrome, skipping Safari;
  • You can use Command-C to launch URL schemes on other devices: leave Command-C open on the receiver device, send it a URL scheme that links to Command-C itself, and watch what happens.

For a 1.0 release, the power-user automation features that Torrisi implemented are well-considered and useful. For a future update, I think the app should provide an easier way to handle device names without encoding them (and thus running into issues with apostrophes or other characters).

Wrap Up

Command-C makes intelligent use of iOS 7's new background notification system to improve on the old concept of a local clipboard sharing tool. Thanks to iOS 7, Command-C can always listen for clipboards shared by other devices and preview what's been pasted with notification banners. At this point, Command-C is hitting another major roadblock in iOS, which is being able to send data to other apps without opening the main Command-C app. Perhaps one day it'll be possible to copy something on your iPhone and send it to your iPad without launching Command-C first; today, you'll still have to at least open the app to send your clipboard.

Command-C isn't powered by a cloud service: you'll have to use multiple devices on the same local network to take advantage of it. The decision comes with pros and cons: your clipboard is never sent to any cloud service, but you need to be on the same WiFi for the app to work.

Torrisi needs to decrease the error rate of the app. In my tests, Command-C has worked as advertised about 80% of the time; occasionally, I had to manually open the iOS app because it “got stuck”. My understanding is that bugs in iOS 7 may be the culprit, so here's to hoping that iOS 7.1 will improve the general performance of the app.

I like Command-C. I'm using it every day to share my clipboard across my three devices when I'm at home4 and I'm a fan of the power-user features available through URL schemes and browser integration. I see Command-C as a modern, simpler Pastebot: built for iOS 7, available on the iPad, and always running in the background. Command-C for iOS is Universal and $3.99 on the App Store; Command-C for Mac is free on the Mac App Store.


  1. On the Mac, you can also show the menubar app with a hotkey and choose a device from the list with the keyboard, hitting Enter to send. 

  2. When pasting an image to OS X, the file is converted to .TIFF. Torrisi told me that this is the format the OS X clipboard prefers, but I'd like to see a setting to preserve the original JPEG/PNG format of image files. 

  3. To make these work, change the included device names to match the ones for your devices. 

  4. The app should also work through Personal Hotspot if you're sharing a connection on the go. 

• You should follow the author on Twitter here.

Tags:appstore, iOS 7