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 <mfcabr...@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


_______________________________________________
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 via email to