Hi List,
Just in case anyone else is getting VCS files (Outlook emails) as attachments and wants them imported seamlessly into Org, I have an alpha version of this workflow that works for me.
On OS X, I made an Automator App called
vcs-to-org-capture.app, put it in ~/bin/, associate this app with .vcs file extensions, and its sole contents is a shell script action: "~/bin/vcs-to-org-capture.sh $@"
The vcs-to-org-capture.sh shell script contents follows. It uses
vcal.pl (
https://github.com/hangyan/Code/blob/master/perl/vcal.pl) to parse the VCS file, extracts the date, start time, stop time, summary, and location, and then calls org-protocol with all of that. It also puts the entire VCS (text version) in the body of the capture.
#!/bin/sh
cd ~/tmp/
cp $@ ~/tmp/vcal.vcs
~/bin/
vcal.pl -all ~/tmp/vcal.vcs > ~/tmp/vcal.txt
DATE=$(grep "event start: " vcal.txt | cut -c10-25 | tr -dc '0--9')
T0=$(grep "event start: " vcal.txt | cut -c 25- | tr -dc '0-:9')
T1=$(grep "event end: " vcal.txt | cut -c 25- | tr -dc '0-:9')
SUMMARY=$(grep "SUMMARY" vcal.txt | cut -d';' -f2)
LOCATION=$(grep "LOCATION" vcal.txt | cut -d';' -f2)
ALL=$(cat ~/tmp/vcal.txt)
TITLE=${SUMMARY}\ [${LOCATION}]
DT=$(echo \<${DATE} ${T0}\-${T1}\>)
~/bin/emacsclient "org-protocol://capture://V/${TITLE}/${DT}/${ALL}" &
The org-protocol capture template I use is the following, where I use "** EVENT" for calendar events.
("V" "VCS via org-protocol"
entry (file+olp "/path/to/
calendar.org" "Events")
"** EVENT %:link\n %:description %? \n\n%:initial")
This works for me if I double-click on a VCS file on the desktop, or <RET> on one as an attachment in mu4e. As I write this email, I realize it should do one more thing, which is provide a link back to the original mu4e email that had the VCS attached. I don't think this is possible with the current workflow that uses the OS X Automator app.
I hope this is helpful to someone...
-k.