whups, sent before ready!
to use select and copy text between braces, {{{ }}}, into a Leo outline,
select the new node and press Ctrl-B.
adapted from
http://stackoverflow.com/questions/8985925/how-to-control-what-version-of-python-is-run-when-double-clicking-a-file/
-matt
On Tue, Apr 30, 2013 at 1:02 AM, Matt Wilkie <[email protected]> wrote:
> Here is a Leo script which attempts to tell Windows how to handle .leo
> files, enabling 2x-click "some-workbook.leo" to start. On win7+ it requires
> Leo be started with elevated admin privileges.
>
>
> {{{
> <?xml version="1.0" encoding="utf-8"?>
> <!-- Created by Leo (http://webpages.charter.net/edreamleo/front.html) -->
> <?xml-stylesheet ekr_test?>
> <leo_file xmlns:leo="http://www.leo-editor.org/2011/leo" >
> <leo_header file_format="2"/>
> <vnodes>
> <v t="maphew.20130429234409.2286"><vh>assoc leo</vh></v>
> </vnodes>
> <tnodes>
> <t tx="maphew.20130429234409.2286">pyexe = g.sys.executable
> tmp = g.os.environ['TEMP']
>
> assoc_cmd = 'assoc .leo=Leo.File'
> ftype_cmd = 'ftype Leo.File="{0}" "%1" %*'.format(pyexe)
>
> #g.es(pyexe)
> #g.es(tmp)
> g.es(assoc_cmd)
> g.es(ftype_cmd)
>
> from subprocess import Popen
> Popen('start "Shell from Leo" cmd.exe /k %s && %s' % (assoc_cmd,
> ftype_cmd),
> cwd=tmp, shell=True)
> </t>
> </tnodes>
> </leo_file>
> }}}
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.