emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Miguel Fernando Cabrera <mfcabrera@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Org Babel, Ruby and Outlook
Date: Thu, 15 Oct 2009 18:26:39 -0600	[thread overview]
Message-ID: <m2oco8yyio.fsf@gmail.com> (raw)
In-Reply-To: <330fb75e0910151547v3ded75f3wdd6d90f06009f558@mail.gmail.com> (Miguel Fernando Cabrera's message of "Thu, 15 Oct 2009 17:47:01 -0500")

Hi Miguel,

That is a very cool application.  To insert your script's results
directly into the Org-mode buffer try changing your header line from

#+begin_src ruby :results output

to

#+begin_src ruby :results output raw

as this seems like the sort of thing which would be generally useful,
would you mind if it is added to the "Library of Babel"?

Best -- Eric

Miguel Fernando Cabrera <mfcabrera@gmail.com> writes:

> Hi All,
>
> In a similar way to  [1],  I want to import my Outlook appointments into Org. I thought of a less
> sophisticated way to archive this using Org Babel.
> I coded a Ruby script to "print out"  the Appointments in Org Format so I can see them in the agenda
> view.  I execute the code using the ":results output" header option to get the output from the ruby script
> (check the script below).
>
> Now, the only problem is that the output of the script is always surrounded by  #+begin_example and #
> +end_example. I was wondering if there is a way to prevent this. What I want is  the text lines to be put
> on the Org buffer so Org can interpret them as headlines.
>
> Also, I tried to get the output using a vector (value mode), but for some reason I was getting "End of
> File During Parsing" message when executing the script. I think it has to be with some characters in the
> Subject properties of the Outlook appointments.
>
> Any help will be really appreciated.
>
> [1] http://osdir.com/ml/emacs-orgmode-gnu/2009-04/msg00264.html
>
> -----------------------------------------------------------------------------------------------------------------
>
> #+begin_src ruby :results output
>   require 'win32ole'
>  
>   def to_org_date(otStr)
>     "<%s>" % otStr.gsub("/","-")
>   end
>  
>   def to_org_interval(start,endd)
>     to_org_date(start)+"--"+to_org_date(endd)
>   end
>  
>   outlook = WIN32OLE.new('Outlook.Application')
>  
>   mapi = outlook.GetNameSpace('MAPI')
>   calendar = mapi.GetDefaultFolder(9)
>   puts "* OUTLOOK APPOINTMENTS"
>   calendar.Items.each do |appt|
>     puts "** #{appt.Subject}\n #{to_org_interval(appt.Start,appt.End)} "
>   end
> #+end_src
>
> ------------------------------------------------------------------------------------------------------------
>
> --
> Miguel Fernando Cabrera Granados
> http://mfcabrera.com
> "A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es
> mayor el viento que se opone a su ascenso." - José Ingenieros
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2009-10-16  0:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 22:47 Org Babel, Ruby and Outlook Miguel Fernando Cabrera
2009-10-16  0:26 ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2oco8yyio.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mfcabrera@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).