6 ms·
My favourite small detail on the Mac, is how the clipboard interacts with the filesystem. You can select some text, drag it into the Desktop and it will become
by aduitsis 6y ago
My favourite small detail on the Mac, is how the clipboard interacts with the filesystem. You can select some text, drag it into the Desktop and it will become a .Clipping. Now, if you drag and drop that clipping into a text field (e.g. textedit), it will be as if it was pasted.
- anthk 6y agoKDE used to work like that too.
- heavyset_go 6y agoIt still does.
- hamburglar 6y agoThis is certainly true for data types that the system knows how to serialize and deserialize, but (at least back when clippings were introduced) for others, the app that owns the clipboard data must provide the hook for the serialization and deserialization. Back in my first programming job, we were about to ship a shrink-wrapped software product that I will not name but you’ve almost certainly used, and we discovered that we “needed” to support clippings or else (I can’t remember if this was some Apple compatibility rule or some marketing person’s rule). We didn’t have much time, and we also didn’t have serialization code for this very complicated data structure that was on the clipboard, and my manager told me to just implement it by sticking THE POINTER in the clipping. I objected and was overruled. I did it, it shipped that way, and I will always be ashamed. You could only use a clipping in the same process that created it. I had to add code on the deserialize that checked to see if the pointer was valid. It still makes me sick to think about.
- marmaduke 6y agoThat’s the practical approach .. and you are lucky to have a manager who is technical enough to make suggestions like that
- hamburglar 6y agoThere is nothing practical about writing a pointer value to a file. This was a quick hack that made the feature appear to work rather than actually work. It's really bad engineering.
- marmaduke 6y agoI agree with you, before the external constraints enter the picture. But as you said, it had to be delivered with this feature on a shorter timeline than a better solution allowed for. The choice between delivering something and delivering nothing, how do you proceed there?
- hamburglar 6y agoSlip it or cut it. Doing it in a way that loses data for users is a bad call.
- toomanyducks 6y agoSort of reminds me of Plan 9, with the ability to treat text as executable, where execution can include opening a file in a designated application. I haven't used either OS for more than a cumulative 10 minutes, but this was definitely my favorite part of Plan 9.
- ithkuil 6y agoYou can play with a user space port called plan9port (https://9fans.github.io/plan9port/ https://9fans.github.io/plan9port/) where you can run the "plumber" executable, edit your rule file and then just invoke the plumb command with some text and context and have it do things. It also comes with the acme editor and other tools. This way you can have some of the fun of plan9 but keep your modern amenities such as wifi, a browser and whatnot.
- MisterTea 6y agoText isn't executable in plan 9 but it plays a major role in the design of how you interact with the system. The functionality you describe sounds like a mixture of Acme(1) text editor and the plumber(4) file server. Acme editor allows you to exec highlighted text so long as the highlighted portion is a valid command string. For example: if you wanted the date printed in the Acme window from date(1) all you do is type <date, highlight it, middle click it, and date's stdout is redirected into the editor and the highlighted text is replaced with the output of date. Without the '<', the output would redirect to a new window. You can also put commands into the tag bar and right click them to execute. So when I'm writing plan 9 programs, I put mk into the tag bar of the programs directory and just click mk. Of course Acme works hand in hand with the plumber and you can send plumb messages from Acme too. Right clicking text in Acme plumbs it. The plumber is a really neat program. All it does is listen for messages that are plain old text, tries to match the message to a rule, and that rule has an associated action. You load the rules by simply copying the rule file to the plumber rule file. So for example, you send a url to plumber, it's rule looks for http:// http://, matches it to a rule that says open mothra or netsurf and use the url as an argument and the website open in the browser. If you're inside acme and right click a header file in acme, plumber then just tells acme to open that file (assuming acme is in your rules file for text)
- Wowfunhappy 6y agoThis is also why Mac apps built using frameworks other than Cocoa (or Carbon) never feel quite right! Sure, you may have recreated the copy and paste menu so it looks and feels identical. But did you remember to handle .clipping files? What about File > New From Clipboard? What about the system-wide custom keyboard shortcuts? Oh, and don't forget to make it all behave properly with Voiceover!
- kridsdale1 6y agoThis is why it sucks so much that many important "apps" are electron shells.
- danellis 6y agoAdvocates of Electron sometimes claim that it unifies the look of the application across platforms. This should not be a goal. Most people are far more like to use several applications on one platform than use one application on several platforms. It is the platform that the apps should be conforming to, not themselves.
- yagya 6y agoExactly why I prefer Seaglass over Element for Matrix chat, even though Seaglass hasn't been updated in a while. Same with Telegram Desktop and Telegram for macOS.
- saagarjha 6y agoI have yet to find a Telegram client that is a good Mac citizen :/
- yepthatsreality 6y agoThis isn’t true, the reason devs use Electron is for market share not some design-usage principle.
- 6y ago
- quietbritishjim 6y agoWindows had a very similar idea to that, called "shell scraps" [1]. The feature was removed because basically nobody ever used it (and it was a vector for viruses) [2]. [1] https://en.wikipedia.org/wiki/Shell_Scrap_Object_File https://en.wikipedia.org/wiki/Shell_Scrap_Object_File [2] https://docs.microsoft.com/en-us/previous-versions/technet-magazine/cc194424(v=msdn.10)?redirectedfrom=MSDN https://docs.microsoft.com/en-us/previous-versions/technet-m...
- heavyset_go 6y agoKDE's Plasma Desktop allows you to do this. You can drag text from any app to the desktop, and it will turn it into a Note. You can right-click and paste, or Ctrl+V, on the desktop or the file manager, too, and it will save your clipboard contents as a file for you. Same thing works for images, videos etc.
- akdor1154 6y agoNow copy and paste that file into kedit or kword.. what happens?
- heavyset_go 6y agoI just dragged a text file into Kate and Kate opened it.
- amatecha 6y agoAh yeah, text clippings are an amazing feature. The feature was added in 1994, for System 7.0 or newer[0]. Super useful. I used to be in the midst of a conversation with someone on Hotline and want to save a snippet of text. Select it, drag to desktop, done. Saved for later as a file I can refer to or even drag & drop to some other program. [0] http://asa.max1zzz.co.uk/English-North_American/Macintosh/System/Other_System/Mac_Drag_and_Drop_1.1.txt http://asa.max1zzz.co.uk/English-North_American/Macintosh/Sy...