Exporting Contacts to CSV

An AppleScript to export name and e-mail addresses from Contacts.app on Mac OS X to a Comma Separated Values (CSV) file. The created CSV file is suitable for importing into numerous other tools and services.

I wrote this script for Mac OS X 10.9, Mavericks, but it should work without too many changes on most recent versions of Mac OS X.

To use this AppleScript:

  1. Launch AppleScript Editor from Applications > Utilities
  2. Copy and paste the code below into a new document
  3. Run the script
  4. On completion a contacts.csv will appear on your desktop
-- Save comma separated values (CSV) file to desktop
set exportPath to (path to desktop as string) & "contacts.csv"

set contactsCSV to "" -- variable to collect rows of addresses
set quoteString to "\"" -- constant to ease concatenation

tell application "Contacts"

	-- Repeat with every person in your Contacts
	repeat with x from 1 to the count of people
		set thePerson to person x
		set theirName to the name of thePerson

		-- A person may have multiple e-mails addresses, add one row for each
		repeat with anEmail in the email of thePerson
			set contactsCSV to contactsCSV & quoteString & theirName & quoteString & "," & quoteString & (value of anEmail) & quoteString & "
		end repeat
	end repeat

end tell

-- Write the CSV contents to a file
set exportFile to open for access file exportPath with write permission
set eof of exportFile to 0
write contactsCSV to exportFile starting at eof
close access exportFile

Spring Flowers in Parc de la Tête d’Or

The daffodils seemed to come out early this year. Since late February, our nearby Parc de la Tête d’Or has seen a succession of colourful flowers. Some in carefully managed flower beds, and others emerging through the grass.

Cherry blossom tree

This cherry blossom tree is a favourite spot for picnickers.

Daffodils by the pond

Daffodils by the pond

A fuzzy poppy bud

A fuzzy poppy bud

Bright poppies

Bright poppies

I put together a short video to capture the flowers while they are still in bloom. Each only seems to last a couple of weeks. Already the daffodils and magnolias are fading, replaced by tulips and poppies.

Lyon Funicular – Fourvière to Saint-Jean

“Going to put that on Facebook.” the man nearby  pondered aloud. I was not convinced he wanted an answer or even intended I could understand him. He had spoken in English more to himself than to anyone else around.

I stood by the front of the cab, camera in hand, quietly capturing the journey down from Fourvière.

With the camera recording the last thing I wanted to do was reply and spoil the audio. I smiled and that appeared to be enough. The camera’s microphone is terrible but the audio would be unsalvageable with a conversation over the top.

The funicular saves the crowd a walk up the steep hill that overlooks the old town of Lyon. The walk is not bad and we had come up this way earlier that day.

For our return we took advantage of the rare free transport being offered and I took my opportunity to put together a short film, Fourvière to Saint-Jean.

Learning to Edit

I think the process of editing my first video has taught me more about filming than editing.

When I started my filming experiment, I didn’t set out with a story to tell. We walked around the park, I filmed things that caught my attention, and I said whatever came to mind. I made it up as I went along. When the time came to edit all those film snippets into a video, this was the biggest hurdle. I had a disparate collection of film snippets from around the park, and no idea what I wanted to do with them.

My biggest lesson from this process? Know where you are going before you begin.

Once I had figured out what I was going to do with my film snippets, the actual process of putting them together wasn’t too bad. Graham gave me a crash course in using iMovie before I got started, which sped things up.

It took me an afternoon to edit the video together. It was fiddly and time-consuming, rather than difficult. I felt I could have spent forever tweaking and adjusting things.

The result

The result of my filming and editing experiment is a very short video of Lyon’s Parc Feyssine.

You won’t see me in it. The majority my snippets either had me in them, or me speaking over them, but in the end, I couldn’t get past the cringe factor. So, the final video is shots of the park with the background noise of other visitors and some energetic song birds.

I don’t think the video is particularly interesting, but it is nice to come away with something. And, it is a point to improve from.

Learning to Film

Last weekend, as we walked in the park enjoying the spring sunshine, I took out my camera and started an experiment. An experiment in making videos.

It is something I have been pondering for a while, but haven’t rushed to start. I have ideas for future projects that I think will benefit from video. While these projects are a long way off, I knew the learning curve for filming and editing would be steep. I figured it was best to start learning now, long before I actually need those skills to bring something together.

As it turns out, I’m going to need that time and practice. Speaking to the camera is not something that comes naturally to me. Watching it afterwards was partly comedic, partly embarrassing.

But, it was an experiment after all. The purpose was to see what was even possible, not to produce a brilliant video on my first attempt. And as an experiment, it was successful. I learnt that my little point-and-shoot camera can take reasonable video with reasonable sound. I also had a lot of fun running around the park filming things; much more fun than I expected. It has promise.

The next step is editing. I have a collection of film snippets to play with. Some with me in them, some with me speaking, and some just of the park. Again, it’s an exercise in seeing what’s possible and getting a feel for the tools. I don’t expect to come away with a video I feel comfortable publishing.

I’ll keep you updated.

As an aside, Graham has a head start on me in this area; he has made many short films over recent years. I’m glad to have his help at the beginning of my journey.

Amazon links on this page help support running The Work Life.