Mac Mail Scripting: Send Message to Evernote

I’ve been trying to replicate the “Send to Evernote” button that gets installed with Microsoft Outlook 2013 at my work to also be an option for my Mac Mail app. My first stab was to see if there was some sort of toolbar button I could use, nope. Evernote hasn’t gotten that far yet.

I looked around Automator, hoping, and saw nothing for Evernote in Automator. So then I thought I would turn to AppleScript. I opened up the AppleScript editor, then opened up the AppleScript Dictionaries for Mail.app and Evernote.app. Through a series of web searches I figured out two main things:

1) How to extract the sender, subject, and content of an email in AppleScript
2) How to create a new Evernote Note with the details gained from Step 1

So, here’s how I did it:

Open up AppleScript Editor and copy this code into it:


tell application "Mail"
set theSelection to selection
set theMessage to item 1 of theSelection
set theText to content of theMessage
set theSubject to sender of theMessage & " : " & subject of theMessage
tell application id "com.evernote.Evernote"
activate
create note with text theText title theSubject tags "mail"
end tell
delete theMessage
end tell

Then you need to do some clever things in AppleScript Editor to get this all to work properly:

1) In AppleScript Editor, open Properties.
2) Put a checkmark in “Show Script menu in menu bar”
3) Close the Properties dialog box
4) Save your AppleScript to your Desktop called “Send Email to Evernote.scpt” and save it.

Now you have to install your script:

1) Open a finder window, arrange it so that you can see the finder window comfortably and also see your script on your Desktop.
2) Navigate to your Macintosh HD, then Library, then Scripts, then Mail Scripts.
3) Click and drag the “Send Email to Evernote.scpt” into the Mail Scripts finder window. Your Mac will stop you, ask you to Authenticate, so do that. The file should copy into this folder.

Now when you go back to Mac Mail, you’ll notice a little script icon in the menubar. Click on the Script menu bar item, then click on “Mail Scripts” and then click on Send Email to Evernote. Your Mail message will disappear. The message has gone to the Trash, and the text of it is now in your default folder in Evernote, with the senders name, a space, a colon, a space, and the subject of the message as the title of the note, with the contents of the note set to be the contents of your note itself.

That was enough for me. Please note, this script creates notes and deletes mail. There are no guarantees that this script will work for you. I don’t really support it as I barely understand AppleScript as it is. It works with just one message at a time and it’ll probably butcher attachments and I have no idea what HTML messages will do if subjected to this sort of treatment. An epic-level “Your Mileage May Vary”, so you know, be careful.

When The Lights Went Out

Lightning_03Yesterday was one hell of a powerful storm. The wind was magnificent and the storm itself was chugging along at a heady clip, around 55 miles per hour by the reports from the weather service. The tree in front of my residence is a red oak, and I’ve always known that red oaks have a reputation for shedding lots of branches and it did not disappoint! We lost about 10% of the canopy in front of my house including one big branch that dug a foot long gouge out of the turf in the grass between my house and my next door neighbors. I pushed the torn sod back into place and stomped it flat with my shoes, so that’s fine, but the front of my house looks a little like a war zone where the trees and the wind went to battle.

My next door neighbor, across the street lost a giant part of her tree and it took out her power and cut mine as well. Thankfully her house didn’t suffer any structural damage, just a big bit of tree where it doesn’t belong. I had a time warning neighbor kids away from the area since it was a downed power line. Nobody approaches downed power lines, even if the power is out. Much like a toaster, a downed power line remembers and seeks bloody revenge, you don’t handle the line as much as you don’t rescue the piece of toast in the toaster with a fork. When my across-the-street neighbor returned I let her know that I contacted Consumers Energy and let them know about the downed line and the damage.

Losing electricity has returned our lives to simpler more fundamental conditions. When the sun is up, daylight makes living easy. The water pressure and water quality are unchanged, so the sinks, toilets, and showers all work properly – except that the hot water tank has an electric heat control, so whatever hot water comes out of the tank will be all there is for a few days. Much of the technology in our lives no longer works. The network connection is of course dead, along with the entertainment center. We don’t have TV per se, but the general entertainment for that part of our lives is no longer possible while electricity no longer flows. Life goes on, and without technology it can continue to go on quite well. It’s important to establish a solid thread running into the past, I’ve always been fond of old technology, especially things that do not require electricity. So we have a lot of battery-powered devices and wind-up clocks and automatic watches to keep the time. Our refrigerator is very slowly reaching the same temperature as the surrounding environment that it’s in and that’s unavoidable. We’ve transferred much of the expensive food out and into the freezers where Scott works. The rest of the contents of the refrigerator are not exactly perishable, things like OJ and mustard I doubt will suffer very much even if they are warm. We’ll lose other bits in there but that’s life. Cooking has become slightly different, as I have a gas range the cooktop is perfectly serviceable with a handy source of ignition but the oven, which requires electronic temperature control doesn’t work. I can cook around that limitation, however the inability to refrigerate means that making anything that we can’t eat in a single sitting is probably a bad idea.

Living this way, without electricity, even temporarily is healthy I think. It reminds us just how reliant we are on the fundamental utility of electrical delivery and distribution. Candles provide light at night, however they are open sources of ignition and are potentially disastrously hazardous, especially with a cat who has no fear of fire because he’s never actually come into contact with it in his life. From what I can see, he lacks even an instinctual aversion to it, which we have to manage. On my list of things to acquire is an LED lantern, something that can last a good long time, puts out a disturbing amount of light, and won’t set a curious feline on fire. Entertainment has changed, it’s different but still equivalent to what our usual fare is during evening hours. Instead of TV programs, network entertainment streams, or movies, we’ve swapped all that out for card games, board games, talking and reading books. Again, retaining that thread that runs into the past is essential. The smart money is on technology that does not require electricity. I’m amused quite deeply that here, steampunk pops up as a relevancy. If everything in your life that used to be automatic is now clockwork powered, you still have a semblance of convenience however the source of power is yours truly. For my watch it’s just movement that winds it, for my emergency flashlight it’s ten minutes of vigorous shaking, but I will need to find some way to provide a pool of safe illumination at night and early in the morning and perhaps some way to charge all my connected devices by human power.

Earlier this morning, when I was taking a “Marine Corps Shower” which is to say, the fastest most efficient and bracing method to clean oneself, I thought of a possible way with a carefully geared pedal generator that one or two people could operate that would be able to collect enough energy from pedaling to keep a refrigerator running, at least give it a boost so it could chill down for a cycle. I’m sure if I’ve thought of it, a product exists somewhere out there that can do just what I’m thinking. It’s definitely a first-world problem that only occurs to you when you don’t have the convenience of electricity at your beck and call. That we rarely think of life without electricity, we really ought to. Take a weekend and turn off the house mains (except for the fridge,  you want to simulate a disaster, not initiate one) and then look at life without. What needs to be available to make life possible? A box of candles, perhaps. A LED floodlight with a deep-cycle battery? Much better! Events like these, where you are thrown backwards test your ability to cope and your cleverness.

They say that our electrical power delivery will be returned this Monday around 11:30pm. That being said, they are saying that to everyone, so we are hoping that this is an engineers estimate and that our power will be back on sooner than this. Hope for the best, prepare for the worst. Now I need a way to charge my phone by hand. Funny, your priorities…

photo by:

Comixology

Just updated my Comixology app on my iPad and overhauled my password so I could login. I knew I wasn’t going to find the same app I remember, and I had issues with that one as well. So in we go, talk about a chop-job. I found all the comics I bought, 252 of them, yah, and then on a lark I went looking on how to buy a new comic book. No store that I could find, just a search panel. Searched for Marvel and found all of that, went looking for DC and couldn’t find them. Searched for New 52 and found some titles. So, no more shelf-appeal or browsing titles. Okay.

Then there is the lack of in-app purchasing. Yeah, they are. Owned by Amazon now, so no more of that. Have to go on Amazon to buy the comics. Nope. I don’t like Amazon and it’s a matter of monopoly aversion in my consumer psyche. I do not like Amazon any longer. They are too big, too invasive, and too damaging to people in general. How Amazon treats their workforce is a lot like how Walmart treats theirs. Once Costco opens up here in Kalamazoo, we won’t ever be going back to Sams Club. I won’t ever be going back to Amazon or Comixology.

So, online comics are back to the Stone Age. I’m glad that there are long boxes downstairs with copies of all the comics now lost to me on Comixology. When I have money again, it’s back to the Comic Book Store with me. Comixology’s sell-out was the kiss of death. Amazon won’t be and can’t be controlled. They need to be shunned. If not by everyone, at least this household. There are more considerations on where you buy something beyond the “low price leader”, especially if that leader is a morally and ethically bankrupt monopolistic ravening monster.

The Future is Forsaken

A few days ago, a brand new MacBook Pro 15″ laptop arrived. It is meant for one of my coworkers and I thought I had everything set up to rock and roll. Well, so much fail came to roost today on my shoulders. First, the MacBook, a big beautiful machine requires Windows 7 64-bit to be present to be able to set it up in Bootcamp on this machine, d’oh! I have Windows 7 32-bit on memory stick. Fnord.

As I was fiddling with the unit, and the fact that this didn’t occur to me at all is a testament to how pervasive wifi is in my life, I noticed that this laptop doesn’t have an Ethernet port on it. Apple sacrificed the Ethernet port in the aim to make this sleek slim metal box of sexy technology happen. It’s the 21st century and if someone buys a MacBook, then the logic that I can work out for myself is that Wifi is assumed. Except for when it isn’t. There’s an adapter that will make it work, and frankly I can’t be really shocked that Apple would dump Ethernet especially when there is Ethernet to Thunderbolt adapters for sale, as Thunderbolt can easily carry gigabit data rates and the port is supa-teeny.

So here I sit, this laptop will be starving for Wifi soon, and I need an adapter. After some investigation it appears that the best solution is USB Ethernet adapters as the Thunderbolt adapter (as far as I can tell) fails to understand sleep/wake cycles and that’s a deal-breaker for me. I don’t need gigabit speeds so it all works out to be the same in the end.

It’s interesting to me to witness all the technology that is no longer around by default. COM ports are gone, long ago. CD/DVD drives are gone, which is constant source of surprise to me, and now Ethernet ports are all being shuffled off. All of these things can be adapted to USB, and some of them to Thunderbolt, but these bold choices are surprising me. I find myself agreeing with them, for the sake of the form factor and how USB and Thunderbolt can do so much, it does make sense to me.

God help people who are used to certain historical technologies, they may find themselves on the sacrificial stone block to the gods of progress.

Alternatives to Clouds

I’ve been toying around with a wonderful free utility from BitTorrent Labs called BTSync. You can find it here: http://www.bittorrent.com/sync.

What really drew my attention was the lack of centralized service that stands at the core of BitTorrent technology. It’s distributed, without any company or cloud provider dwelling in the background. All the hardware is owned by you, the “secret” code you use to share that identifies your sync experience also forms the encryption key so that the data that is flowing across the network is secure from prying eyes. Because you own all the hardware and encryption covers the data exchange, you can store whatever you like in your BTSync’ed folder and not have to worry about anyone else peeping over your shoulder or removing material from your storage without your knowledge or permission.

This free system has clients for workstations and mobile devices, so it really can be a drop-in replacement for services like Box, Dropbox, Google Drive, and SkyDrive. You can share the secret with anyone you like and anything you place on the folder set up with BTSync will synchronize across all the connected devices. You can also send “Read Only” secrets to sync your folders to people who you want to have your files but don’t want them deleting or changing your files and since this uses BitTorrent technology you won’t have to pay hosting fees and the more people share the data, the faster the system sends updates and changes and new data to all the subscribers.

I’ve created a Work folder, a Sync folder and have them set up on my work machine, my work laptop, my Mac Mini at home, and my iPhone and iPad. Since I own all the hardware, the maximum storage that I can store on this system is only limited by the smallest storage unit amongst all the shared machines. The folder lives on a 1TB USB HD at home, at work I have hundreds of GB’s available and the same as on the laptop. The storage in Mobile isn’t the same as a full workstation as the BTSync app doesn’t actually download data to store on the mobile devices directly but rather downloads a file list making it possible for you to pick and choose what you need on mobile when you need it. If you need security in the storage components you could leverage Encrypted Disk Images in Mac systems and TrueCrypt Encrypted Volumes on Windows machines. For Linux clients, you could likely use loop filesystems set with EncFS or something like that.

The applications for BTSync are amazing. Freed from middlemen companies I can store anything I like without having to worry about some company evaluating what I’m storing or even being able to respond to warrants to reveal what I’m storing on the service. Something like this could be a great benefit to companies that need to share files without having to worry about “buying into the Cloud” since everything is free. You can run a BTSync on a server, host a folder and share the secret out to all your employees and have a very handy share drive and even if your central server fails, copies of your data are stored on all the connected workstations so to recover the data all you would need to do is download the small BTSync client again, re-establish the shared secret code, identify a folder and watch as all your connected clients swarm and return all your data back to the “central depot” server.

Another wonderful option is to host a family shared folder, where you can store anything you like, securely and backed up amongst all the connected workstations. Alternatively, if you were an aspiring artist you could place a folder with all your work and establish a read-only secret and publish it on your social networks. Not only would all your fans be able to have your work, but you’d also be able to cleverly transform them into a swarm of willing backup sources for your work. If an artist has their secret code and a copy of BTSync client and they lose their primary system and all their data, they can just get a new system, re-establish the client and secret and smile as all their work comes back home as it was stored on all your fans computers. That’s amazing to me!

Getting started using this utility is a snap. Download the client and install it on your system. Then on whatever storage medium you like create a new folder. In the BTSync application itself you can create a new shared folder with a single click, there is a “Generate” button which creates the shared secret for you, you can then determine if you want it to be full-sync or read-only sync and then point the app to the folder you want to share, then minimize the app and you’re all set. Send the shared secret code to anyone you want to share with and your data will immediately be sent to their systems according to your preferences.

BTSync is the best of all worlds. You have a secure cloud infrastructure without anyone in your way, judging you or risking any intrusions from companies or governments.

The Graveyard of Good Ideas

Earlier today I wrote an email to one of my recruiters who is helping me find gainful employment as best as he can. During this composition it occurred to me that there is definite value in some of these “Really Big Ideas” that I have from time to time. I’ve written about this subject before, but this time I started to consider if there was any way to sell this skill that I have, and that it would be a good thing to write about it and perhaps doing so would ‘seed the clouds’ and maybe help me somehow in the future.

It’s an odd skill with an elusive name. What could it be called? It was something that I only started to understand myself late last year after my 38th birthday. There are a lot of things that go into this particular knack, there is brainstorming, mind-mapping, and extensive applications of imagination. I love the notion of a “Thought Palace” which I picked up from reading a lot of Sherlock Holmes stories and for me, it’s not as structural as it might have been for the protagonist of those stories but the metaphor really rings true for me. It all starts with a problem statement. As I look back on my life I find that this pattern has been with me for a very long time and it’s only recently that I’ve been able to put a finger on it and approach the task of devising what it actually is all about. These problems sometimes are very deep, and sometimes not; sometimes they are filled with deep personal importance and sometimes not. The procedure, if there could be something procedural to it tends to follow the same overall pattern, brainstorming leads to a froth of ideas, images, opening up like a sea of possibilities before me. My mental landscape is littered with all of this material, laying about in boxes and just resting on the metaphorical mental ground. This seems to work even if I don’t brainstorm first, but it seems to hasten the entire operation if I do. The key for me is to quite literally sleep on it. I keep the problem firmly in mind, I’ve got a field of mental raw material littered about my consciousness and then I turn my back on all of it. In a few days, and as oddly as it seems, during a relaxing hot shower or bath usually, the end product arrives in my mind. It is an unusual sensation, just standing under the flow of water and a tightly coiled spring appears in my mind and then uncoils. The problem stands solved before me, and all I have to do is write it all down. I know it will work, and there are indelible certainties that any rough spots couldn’t possibly be show-stoppers.

Examples of these great ideas then get written down. And here is the rub for me personally, that I’ve got what amounts to a rather full suburban graveyard filled with these marvelous and certain to be successful ideas. I have to write them out, and then bury them alive because they are too valuable to actually share. It comes down to idea ownership, to actually make good on all this work that I’ve done for people who never asked me to do the work in the first place. These ideas could be very lucrative to me personally and in my current stage of life, having any of these ideas get stolen and benefitting someone else chills me right to the core.

Some of these ideas I can characterize without having to expose them, because without copyright to protect all this work, I would be exposed, and I can’t stand that risk. The first one was the most elegant and most important to me personally. It took elements that I had picked up in the non-profit philanthropic space that I have been orbiting for the last fifteen years and synthesized a complete plan that could be put into action by any institution of higher learning which would have the effect of integrating admissions, student retention, development and advancement, and also directly harness young alumni engagement. During my time speaking to people in that sphere of influence in Austin Texas last November, I was asked many times especially about young alumni engagement, and it was all I could do to resist not sharing my great design. I can’t trust that my work would benefit me, so the only people I could share it with are my blood kin, who are the only people who would never betray me for greedy purposes. Once I did share my grand design with my kin, the response was very gratifying. It could be a really great way to “have your cake and eat it too” when it came to encouraging and keeping students in higher education and quite possibly also address the giant mountain of student debt that these students are accruing during their time studying in these institutions. The idea that a student could possibly walk away from their Bachelors of Arts and only have to pay $125 for the entire experience was something that took my breath away. The ability to start your life without being chained to a giant millstone of educational debt keeps this particular idea alive, deep underground in a coffin, but alive still.

Then most recently I had the opportunity to interview for a local “hypermarket” style company that has business throughout the region. Quite by accident while reading the background material I had assembled for this interview experience I accidentally began “priming the machine” and the day before my interview with the company I had another one of these spring-loaded epiphanies strike me square in the head. Again it came during a hot shower, and I found myself speed-talking through the entire package of work, as I find that sometimes self-talk helps me retain all the details, sometimes these ideas can evaporate like the memories of dreams. I discovered that I had everything, mental images of whiteboards, hardware lists, procedure binders, business plans, project visions, even so far as to create marketing and a jingle. It would have led the “Point Of Sale” experience to it’s most extreme limit in terms of speed and convenience. It could have been a Holy Grail for this particular company. Alas, the company did not want me for my baser skills and so the idea was boxed up and buried.

The humor of all of this is not lost on me. What a foolish thing, to be struck with amazing work that was totally unbidden, unexpected, and not-asked-for. I seriously doubt there are ways to even approach unveiling these ideas because they come from so far afield that it’s doubtful they are even standing in the same ballpark. What sort of communication channel exists where you can chat up a company and lay all this out on them all at once? It’s impossible without sounding like you are a lunatic crank. Nobody volunteers such work out of the blue, it just isn’t done. It’s a small bit of entertainment imagining a world where this sort of thing is if not expected not ruled out before it can begin. What would such a world look like? People like me who have what amounts to having accidental revelations just wandering in off the street and changing entire market segments and entire industries, blowing up higher education affordability problems and revolutionizing POS systems willy-nilly.

So that leads to the graveyard of good ideas. I wonder how many other people are out there who have similar experiences. How many other life-changing, utterly disruptive epiphanies are buried in shallow graves? Then I get to wondering if all of this is a flash in the pan or if it is like I suspect, a new talent of mine that will be with me for the rest of my life. How many more holes will I have to dig?

Microsoft in the Cloud

A good question comes to mind, will companies like Microsoft, unhappy with individual flashes of purchasing, like 10,000 units of Windows XP, would rather migrate their users into a cloud infrastructure that replaced these discrete purchases into a steady stream of what amounts to being rental income? It’s starting with Azure and the new CEO has said cloud is the future. This may be where they are heading.

Microsoft might try to corner their own hardware market eventually, shepherding their customers into a cloud model, where you pay for a Windows 9 experience, connecting to Microsoft’s own hardware over the Internet. It would eliminate a huge sector of headaches for Microsoft, as they have never been truly able to strictly control the hardware their operating system runs on, unlike Apple. With a VM of Windows 9 that is remote controllable, Microsoft could provide a channel for their customers to use their suite of applications, achieving a silo lock-in. Instead of selling a license to use Windows 9, Microsoft could simply sell a $50 per month lease to computing resources within Microsoft. The sales pitch and marketing could be incredibly lucrative for Microsoft. Having a virtual OS canned with every application Microsoft makes available for a certain low per-month price, and altering that price based on the performance specifications of the VM ordered, so that clerical staff who need a basic interface can come in at $20 per month and developers who need more can come in at $200 per month.

That would eliminate many hurdles for IT administrators, the client machines could be thin clients, cookie cutter boxes with very little technology in them beyond the human interface components and the network connection. Storage, the VM instances, security, antivirus, the entire ball of wax could be handled by Microsoft itself, playing host to their customers and transforming their entire model from that of a classic production model to a new cloud-based leasing model. It would likely lower their profits for a short time, but the curve would not be so choppy, it would be smooth as leasing models, while working, are steady streams of money.

The risk to this possibility comes from the shift of importance from the local hardware to remote hardware. The weak link is the network itself. Virtual machine technology plays a part in this shift of risk, when you start putting more than one egg in a basket, you really have to concentrate on making sure your basket never fails. In this case, if the network link goes down, the entire affair disappears as if it wasn’t even there. This risk could be mitigated by establishing redundant network connections or having some sort of stop-gap measure devised where a host machine is shipped and installed to perform as a surrogate until the primary system returns to function. I don’t see this being a huge risk, as the Internet was designed to be very resilient to link failures as it is. It would come down to the last-mile service provider and the electrical grid maintaining service.

It’s something that is interesting to think about. Microsoft could do this, and it could revolutionize their business model and perhaps give them an edge in the enterprise level market. Only time will tell.

PAD Book – 1/1/2014 – Stroke of Midnight

January 1
Stroke of Midnight
Where were you last night when 2013 turned into 2014? Is that where you’d wanted to be?”

On the last evening of 2013 I was alone with my two boys during the winter storm raging overhead. My partner had the day before left to visit his family in Albany and I was tending to duties around the house and keeping my two boys safe and occupied. Actually I don’t know who was keeping who happy more. I certainly was a warm lap to sit on and the food-giver, but in a lot of ways they were almost always with me, keeping me company and keeping me occupied with their adorable (and sometimes destructive) antics.

I found a bottle of bubbly wine in our collection from M. Lawrence winery up in the Leelanau Peninsula that I had purchased long enough ago that I don’t really remember when. Around 11pm on New Years Eve I inspected and uncorked the bottle and puttered about the house, a small plate of christmas cookies and a champagne flute that I thankfully found hidden in the rearmost of the top cupboard in the kitchen where we keep all our wine glasses.

At 11:50pm, my iPhone rang and it was Scott with an incoming FaceTIme call. We spent the interval from New Years Eve to New Years Day linked virtually by FaceTime. It was a great use of technology and in many ways we had our cake and got to eat it too. Scott got a chance to visit with his family and we got a chance to spend New Years together, after a fashion.

After 2014 had arrived, I disconnected from FaceTime and finished my glass of wine and with cats in tow, padded off to bed.

Was it what I wanted to do? It really was a matter of what I had to do. I couldn’t leave my two boys on their own for a week as the eldest is the most fragile and I frequently worry after his health and activity level. I was able to use technology to cheat around the edges as it were, to be both at home and in New York with my partner at the same time. I’m so glad I was able to take advantage of the technology and it’s just one more, amongst a gallery of other reasons, why I’m so very glad that I have Apple technology in my life. It made it all seamless and easy. I could have done it other ways, but it would have been a mess. The Apple way is smooth and simple and just as easy as answering the phone.

– This is also the first of the Post-A-Day prompts from the book that WordPress.com assembled to inspire bloggers like me to write more and more frequently.

PAD April 25 2013 – Second Time Around

Tell us about a book you can read again and again without getting bored — what is it that speaks to you?

I read both 1984 and “What Dreams May Come” regularly for different reasons. 1984 is worth reading because it speaks to the dangers of NewSpeak. When I was growing up I decided that expanding my vocabulary was the best single thing I could do for myself, to make me a better person. In 1984, that whole thing is a thread the book challenges and it terrifies me. The quality and the lessons it teaches I think are incredibly valuable. As for the latter book, I read that when I was at the lowest point in faith and it helped by inspiring me to seek out a new faith. I enjoy Richard Matheson for his other works as well, but that book really speaks to me.