Neat! I will try this. BTW, I think 'xdg-open' as a command should do this in a window-manager-agnostic way under (most?) linuxes. I'll give it a try...
On Tuesday, April 6, 2021 at 1:15:52 PM UTC+1 [email protected] wrote: > Here's what I have been doing to create files in directory trees. It > seems much simpler. > > 1. Create a node with the headline *@path d:\temp\aaa* > 2. Create a path with the headline *@path bbb*. Indent it right, under > the *aaa* one. > 3. ... and so on > 4. However far down in the tree you like, create the file(s) you want to > have there. Say its node is* @file test.txt*. > 5. Save the outline. > > After saving, the whole directory tree with the file(s) will be there: > d:\temp > - aaa > - bbb > .... > test.txt > > There is no need to fuss with *active-path-do-something*, etc. > > BTW, I have put a button into MyLeoSettings.leo that will open a file > manager window (File Explorer on Windows) at the current directory of the > selected node, whatever it is. This has been awfully handy. The command > is in an @button node in the @settings tree: > > @button Show Current Dir > # Body text > from subprocess import run > cmd = ['explorer.exe', '.'] > run(cmd) > > This is for Windows. The details would be different for Linux. This does > the same job on my Linux Mint VM, where the file manager is called nemo: > > from subprocess import run > cmd = ['nemo', '.'] > run (cmd) > > On Tuesday, April 6, 2021 at 5:28:36 AM UTC-4 Israel Hands wrote: > >> Thanks Edward - I have added the line about create non existing >> directories to the mysettings files. >> >> Here's the current behaviour... >> >> I have an @path node representing a directory >> >> 1 I right click on the @path node and select active-path-make-dir from >> the path option. Up comes the name directory dialogue. >> >> 2 I type a name for the directory and a sub-node appears beneath the >> @path node. Named in the style /New-Directory/ >> >> 3 I save the outline - but my new directory is not created at this point >> - I get a note in the log file saying - Path will be created if a file is >> saved on it >> I only get this warning once further saves are silent on the matter. >> >> 4 I create a node - Active_Path_Test - under the /New-Directory/ node >> and save the outline - no OS action as yet! >> >> 5 I right click on my new node and select path/active-path-act-on-node >> - no dice - log warning 'Create parent directories first.' >> >> 6 I rename node @auto Active_Path_Test - and save the outline - at this >> point file and directory are created. >> >> 7 I create a new file in the directory from the OS side. >> >> 8 Right click on the /New-Directory/ node and select >> path/active-path-act-on-node and my OS created file appears as a node - >> empty at the moment >> >> 9 I right click on my OS-File node and select >> path/active-path-act-on-node and the content of the file appears. >> >> >> Sorry for the long winded 'path' to here but I guess what is confusing me >> is that nodes which create files on the Leo side have to need to have a an >> '@auto' prefix whereas the glory of Active Path is that files grabbed from >> the OS don't - is that expected behaviour? >> >> Thanks for all your patience. >> >> ta >> >> IH >> >> >> >> >> >> On Monday, 5 April 2021 at 21:03:24 UTC+1 Edward K. Ream wrote: >> >>> On Mon, Apr 5, 2021 at 10:19 AM jkn <[email protected]> wrote: >>> >>>> ooh, I didn't know about that setting - thanks! >>>> >>> >>> You're welcome. >>> >>> Edward >>> >> -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/ea073e27-2a38-4b97-abd2-e4c40febb2f3n%40googlegroups.com.
