Commits

bjoern committed ae60714

added option to post whiteboard picture to evernote; fixed export bug

Comments (0)

Files changed (4)

 # Take a picture of the whiteboard using USB-attached Canon camera
 # correct distortion and upload to flickr
 # assumes that we've already configured camera after plugging in w/ config.sh
-
 echo "(1) Capture Image"
 gphoto2 --capture-image-and-download \
         --filename raw.jpg \
 echo "(3) Delete raw file now that we're done with it"
 rm -f raw.jpg
 
-echo "(4) Upload to Flickr"
-#Now upload using github.com/ept/uploadr.py which looks for new files in /images subdirectory
-#api keys have to be set up in secret.sh
-ept-uploadr/uploadr/uploadr.py
+if [ -z "$1" ]; then
+  echo "(4) No Command line args. Done."
+  echo "Usage: capture.sh [flickr|evernote]"
+else
+  if [ "flickr" = "$1" ]; then
+    echo "(4) Upload to Flickr"    
+    #Now upload: github.com/ept/uploadr.py looks for new files in /images 
+    #api keys have to be set up in secret.sh
+    source ./secrect.sh
+    ept-uploadr/uploadr/uploadr.py
+  else if [ "evernote" = "$1" ]; then
+    echo "(4) Copying image to evernote"
+    osascript create-evernote.scpt `pwd`/images/whiteboard-${dat}.jpg
+  fi
+  fi
+fi
+
         --set-config /main/capturesettings/zoom=2 
 
 echo "(4) Set up Flickr API Keys"
-# not included in hg repository. this has the form
+# not included in hg repository. this file has the form
 # export FLICKR_UPLOADR_PY_API_KEY=...
 # export FLICKR_UPLOADR_PY_SECRET=...
-./secret.sh
+source ./secret.sh
 
 echo "Done."

create-evernote.scpt

+--- create Evernote item with image
+--- pass in absolute path to file
+--- bjoern 6/10/2010
+on run argv
+    tell application "Evernote"
+        create note from file argv title "Whiteboard capture" tags {"whiteboard", "photo"}
+    end tell
+end run

switch-libgphoto-version.sh

+#!/bin/bash
+#switch to older gphoto2 version
+#sudo port installed libgphoto2
+sudo port activate libgphoto2@2.4.5_2
+# sudo port installed gphoto2
+sudo port activate gphoto2@2.4.5_0