Tuesday, October 09, 2012

Consolidating Drawings from Your iPad’s Paper app

I really like doodling around on the Paper app from 53. It’s a lot of fun, and lets me come up with some funky, off-the-beaten-path presentations.

The work involved in getting those images out of Paper and into Keynote or PowerPoint is a hassle, though. You have to fire up iExplorer and dive into the Apps folder on your iPad when it’s docked.


You’ll have to figure out which node under that Journals folder is the book you want. There’s some goo in the model.json files that can help you out, or just look at the Date Modified fields.

Drag that folder over to a working directory on your Mac, then you can start to pull the graphics out. They’re beautiful, high-rez PNG files with transparent backgrounds. Unfortunately, they’re all stored as the same filename in GUID-named folders. <sigh/>

The following Ruby script helps you pull the files out and drop them in a common folder, renaming them on the fly. Run it from the folder holding all the subdirectories with the files. You’ll need to edit sourceDir and targetDir as appropriate for your environment.

require "FileUtils"
count = 0
sourceDir = "/Users/jimholmes/Documents/tmp/Pages"
targetDir = "/Users/jimholmes/Documents/tmp/Consolidated/"
dirContents = Dir.entries(sourceDir)
dirContents.each do |folder|
  next if folder == '.'
  next if folder == '..'
  next if folder == '.DS_Store'
  next if not File.directory?(folder)
  source = File.join(sourceDir, folder, "sketchLayer@2x.png")
  target = File.join(targetDir, "Pages-#{count}.png")
  puts "Source: #{source}"
  puts "Target: #{target}"
  FileUtils.cp_r(source, target)
  count += 1

Mad props to @rubyist who dug me out of some issues with how I was handling the filenames.

My next step some day would be to figure out how to pull this stuff straight from the iPad’s filesystem; however, I’ll have free time for that in approximately 246 years, I think.

No comments:

Subscribe (RSS)

The Leadership Journey