Categories
Mac

Clipboard new-line format when copying from Preview

Today I helped my brother with a Keyboard Maestro macro he needed. Basically, he wanted to take some text from a PDF created by Notability, which inserts new lines to have text flow around images, and remove these new lines.

Preview

Pretty easy, I thought: pbpaste to tr and remove \n. Nope. For some reason, maybe some old Mac OS 9 heritage, when copying text from Preview new lines are saved as carriage returns, i.e. \r.

This stupid behavior means that if you try to pbpaste something which contains line breaks in your terminal, you only get the last line. You can view the full output by replacing \r with \n:

pbpaste | tr '\r' '\n'

This lame thing had me waste some time, so I hope this short post makes your life easier.

P.S.: The full command I had my brother put in Keyboard Maestro is:

pbpaste | tr '\r' ' ' | pbcopy

Followed by a Paste action. This replaces line breaks with spaces and pastes the result.

Categories
Mac

Get rid of the “Open from iCloud” window in Mavericks

Since the introduction of iCloud in many OS X apps in Mountain Lion, we’ve had to live with the pointless “Open from iCloud” window every time we launched these apps. I’m speaking mainly of TextEdit and Preview, but recently even more apps got this useful feature, such as Automator and AppleScript Editor.

iCloud for TextEdit - we all hate this.
This. We all hate this.

But last month Apple released Mavericks, which came to save us from this hell. It offers a great solution: the ability to enable/disable iCloud on a per-app basis, thus allowing us to only have it on apps that benefit from it (Pages and Byword, for example).

Without further ado, let’s go and kill iCloud for TextEdit & co.

It’s pretty easy: just go to System Preferences/iCloud and click the “Options…” button next to “Documents & Data.

System Preferences/iCloud/Documents & Data/Options…A nice popover will appear and it will let you chose the apps in which iCloud documents will be available. Deselect any apps you wish, and then click “Done”.

DIsable iCloud documents in unnecessay appsFreedom. Enjoy the sense of freedom that comes from your apps being iCloud-free again, like in the good ol’ days.

Now, the next time you open TextEdit, you will be greeted with a glorious empty document, ready to be filled with your awesome words.

TextEdit is now iCloud-free