DavidGretzschel

@metta 

https://www.loom.com/share/2c2b6fe5830746f399516eec392a8e57

limitations:
L1: Slower than it needs to be, because there's lots of pauses allowing for TheBrain to catch up.
I haven't cut them down to the minimum.
L2: Adding a Child Thought called "a" and pressing down-arrow, won't always actually select that specific Thought, which would potentially cause the wrong Thought to get the Attachment and be renamed.
L2*: Assumes that Preferences>Behaviour>Update on Hover is enabled.
L3: Assumes that the animations are set to "Fastest", otherwise I'd have to add more delays between key-strokes.
L4: Assumes that that folder doesn't have another folder inside.
L4*: Might require Windows 10.
L5: Assumes that you store all your files, you want linked in the same folder.
L6: Assumes that you want to specifically link the newest file.
L7: Assumes that you're using my hotkeys.

The video isn't doing a great job of explainiing what it does and why. But I'll make a better one, once the script is more mature.


I can figure out how deal with all the limitations except for L5 and L6. 
L1 is just about testing this out. Might leave some margins for when the Brain feels like being a slowpoke, because omg there's more then five things at once on the Plex 🙂
L2 and L2* can probably be avoided by giving the thought a name like "LKDFJAKHFDH" and auto-selecting it via search.
L3 would mean a different script for animation lovers.
L4 is probably something that can be dealt with by using groups in this explorer view.
L4* I'm not sure if the "open file"-dialog is different in Windows 7 or 8. Might need seperate scripts, but I won't write them, cause I don't have Windows 7.
L5 and L6 are somewhat non-negotiable. However the script can be split into pieces to make the linking process faster and more flexible.
L7: Many of the commands used aren't even set by default. But I am providing my hotkeys with my StreamDeck-XL-profile, to which I'll add scripts like these. I'm already making sure that the hotkeys make sense even for people who don't have a StreamDeck and will probably make another repo on StreamDeck just for hotkeys and scripts using those hotkeys.
https://github.com/DavidGretzschel/TB11-StreamDeck-XL

Lenovo Legion Y720 | 32Gb Ram | i5-7300-HQ, 4 cores @2.5 Ghz | GTX 1060 | :{Windows 10 (latest build) |  SSD: Model SAMSUNG MZVLW256HEHP-000L2

Laptop monitor: 15,6 inch, 1920x1080@60Hz
external monitor: 42.5 inch, 3840x2160@60Hz
(I use one or the other, never both at once)
--
Samsung Galaxy Tab S6 256Gb LTE
Samsung Galaxy S10 Plus 256Gb LTE
---
unless otherwise specified, assume 100% scaling
My videos always show the current time & date (look at Windows Taskbar).
---
How to use TheBrain 11 fast (work in progress)

Quote
metta
@DavidGretzschel ~

Wow! You definitely are the whiz-kid, David! You just got through telling us in our new Discord discussion that you don't see yourself doing "esoteric database stuff", but I'm plenty impressed! Ã°Å¸Ëœâ€°

Nonetheless, since I'm still on Win7, I may have to wait to to avail myself of your genius script until I migrate to Win10 -- but I will definitely follow your script development with interest.

In the meantime, since I'm definitely NOT a coder, I remain intrigued by how you get the script to interact successfully with both TheBrain and your file manager.

I'm also wondering: once the folder is activated, can the user navigate up OUT of the folder to find files located elsewhere? Or, do all the prospective file attachments for TheBrain need to be in ONE single folder in the file manager?
Quote
DavidGretzschel

@metta
You give me too much credit.
I'm not interacting with anything. I just tell Autohotkey which buttons to press.
AHK is really simple to use and set up.
And my scripts can be downloaded and easily modified with a text editor to adapt them to whatever your TB-keybindings or animation settins are.

To understand what I did, one needs to know only a couple of basic things.
In general:
Install AHK, create a .txt, write your code and change the fileending to ".ahk".
Now double-click it and it will run in the background. 
Edit it again by finding the option when right-clicking the file.
Not sure how to put a script, so that it's run at systemstart in Windows 7, but that's just a google away.

For setting up a single hotkey, you follow this format:

trigger :: action(s), Return,

For rebinding multiple keys in one script, just start do the same things again in a new line.
comments:
this is code     ;  comment, till end of line. Extra spaces are ignored, added for readability

To specify which keys you want to refer to do this:
^=control, +=shift, !=alt, #=windows key, characters in lowercase, special characters as themselves

If you want to refer to (possibly modified) F-keys or other things that you don't write anything in text,
you do it like that:
{F1} to {F12}, {Enter}, {Tab}, {Delete}, {Home}, {End}, {PageUp}, {PageDown} etc.
To call "alt" in isolation, use {Alt}.

When you don't know how to refer to a key, just google it, someone else will have asked it already or you'll find the official reference for it.

Commands:
I only use "Send, a bunch of keystrokes" and "Sleep miliseconds" for adding delays so the system can catch up. Keystrokes are seperated by spaces.
Example:
Send ^a {Enter}; executes ctrl+a, then presses Enter immediately afterward

trigger:
To the left of ::, Looks like this:

 k::action(s) Return,    ; for rebinding k (which is a terrible idea)
!k::action(s) Return,   ; for rebinding alt+k
^!+::action(s) Return,   ; for rebinding ctrl+alt+shift+k


actions:
When you add a linebreak, you have to repeat the Send-command.
Do them anyway to keep it readable for yourself.
Comment frequently between lines.

So if we were to isolate the third part of the linking-script and create a keybinding (ctrl+k) for that part alone, it looks like this:
; third part, rename the Thought to the Attachment-name
^k::
Send ^!p; my TB11-binding for Attachment>Rename
Sleep 500; very conservative delay to let TheBrain catch up
Send {End}; moves the cursor to the end of the word, so that we get the fileending
Sleep 500; delay
Send +{Home}; holding shift and the Home-key to 
Send ^c {Esc}; pressinc ctrl+c and then pressing Esc
Sleep 500; delay
Send !{Enter}; pressing alt+enter to call up the Thought rename-menu which
; conveniently auto-selects the Thought-name
Sleep 500; delay
Send ^v; paste over with the Attachment-name
Send {Enter}; press enter to confirm
Return,    ; end the keybinding

One doesn't have to give Sleep it's own line and one could easily put everything in one line,
but I find that difficult to read.
You can also increase the sleep-delay to several seconds, so that you can see what each step does in isolation.
After you know it works reliably, cut down the sleep-time to the minimum, so it runs faster.
The question is always: How exactly can I do what I want to do, using the keyboard alone.
Write that down and translate it into AHK and you have your very own script.
Annoying error-prone things that would take many seconds and much concentration can thus be done nearly-instantly.

Lenovo Legion Y720 | 32Gb Ram | i5-7300-HQ, 4 cores @2.5 Ghz | GTX 1060 | :{Windows 10 (latest build) |  SSD: Model SAMSUNG MZVLW256HEHP-000L2

Laptop monitor: 15,6 inch, 1920x1080@60Hz
external monitor: 42.5 inch, 3840x2160@60Hz
(I use one or the other, never both at once)
--
Samsung Galaxy Tab S6 256Gb LTE
Samsung Galaxy S10 Plus 256Gb LTE
---
unless otherwise specified, assume 100% scaling
My videos always show the current time & date (look at Windows Taskbar).
---
How to use TheBrain 11 fast (work in progress)

Quote
DavidGretzschel

As for how to work with the file-manager:
TB11 will open the file-manager always in the same view it was before. So same folder, same view-setting, same sort-setting (sorted by "modified"-date in my script). Each view-setting and sort-setting is also saved for each folder individually. That's somewhat helpful, if one only uses the same folder.
When you open the dialog there's a configurable navigation bar on the left.
Everything you can do in the file-explorer you can do via keyboard, so you could also set up different hotkeys to go to different folders, if you wanted to. It all boils down to counting how often you have to press tab, how often to use up or down-arrow to get where you need to be. And how many tabs you need to get to the sort-setting or view setting (in Windows 10 you can switch between the different view-settings with ctrl+shift+1 to 8, what you'll want is ctrl+shift+6 to get a view where you have sort-fields (screenshot); probably works the same or in a similar way in Win7).
Also make sure to edit the script if you change the nav-bar. Best would be to set it up once and never touch it again.

Click image for larger version - Name: ViewViewView.png, Views: 54, Size: 32.17 KB
Quote
DavidGretzschel
Good keys to use for scripts are the F-keys with shift, since they're never used for anything else.
A bad idea would be rebinding alt+F4, because then you're overwriting the OS-keybinding for "close window".

For general comfort when using windows, I rebind win+q, win+w, win+e to open my favorite folders.
If the system or a program uses the key you're rebinding, AHK always overwrites it.

Lenovo Legion Y720 | 32Gb Ram | i5-7300-HQ, 4 cores @2.5 Ghz | GTX 1060 | :{Windows 10 (latest build) |  SSD: Model SAMSUNG MZVLW256HEHP-000L2

Laptop monitor: 15,6 inch, 1920x1080@60Hz
external monitor: 42.5 inch, 3840x2160@60Hz
(I use one or the other, never both at once)
--
Samsung Galaxy Tab S6 256Gb LTE
Samsung Galaxy S10 Plus 256Gb LTE
---
unless otherwise specified, assume 100% scaling
My videos always show the current time & date (look at Windows Taskbar).
---
How to use TheBrain 11 fast (work in progress)

Quote
metta
@DavidGretzschel ~

Thanks so much for all the detail! I appreciate your help and feedback immensely. 

Unfortunately, I am currently dealing with a crippling email delivery issue on my primary business email account, so I'll have to return to your helpful hot key tutorial after this email glitch has been resolved ... hopefully once and for all.
Quote

Newsletter Signup  Newsletter        Visit TheBrain Blog   Blog       Follow us on Twitter   Twitter       Like Us on Facebook   Facebook         Watch Us on Youtube  YouTube       

TheBrain Mind Map & Mindmapping Software     Download TheBrain Mind Mapping Software