Hi,
I often find myself having ideas on the fly while working in different Apps. So I'd like to use FN+N to open up a BTT textfield to type in my thoughts and if I press FN+N again, the floating menu closes but keeps my notes. No need for big formatting issues, just plain text which I then might copy and paste to Notes.app or Pages.app
Might this be done with BTT?
Here is a floating menu preset that keeps notes per app window and can be shown using fn+n:
FloatingAppNotes.bttpreset (45.2 KB)
3 Likes
I got goose bumps, your preset saves per TAB in Safari, that is insane, Andreas! If this is valid/ stable/ so notes stay after restart (which do right now), I will forward BTT with this preset to friends. Amazing!
Short questions:
- In the JavaScript you set a save variable so after restarting the content is still in the Notes, right?
- Visual glitch I can't solve: it pops up around left bottom area and slides within 500ms or so to the mouse cursor.
- Within Finder or iCal the text shows up immediately. I've got the feeling with Safari it takes a 2nd approach? Could be connected to the TABs feature, maybe?
Anyway, I like this preset. Thank you so much for sharing.
Mini-Feature-Request:
- can I tell BTT to set the text cursor automatically so I use FN+N and can directly type in?
- I was so hyped that I created different LogicPro Song-sessions to see, if like Safari BTT may differentiate, so I could finally have my Song notes with a single key stroke. But that wasn't happening.
Yes the notes should still be available later. Maybe we can add a mode that shows all notes regardless of active window.
I also noticed the visual glitch. Should be fixed with the next BTT alpha. Same goes for the autofocus, there is already an option for it, but for some reason it fails here. I'll have a look.
It uses the window title as a key to store the note. Probably LogicPro Song-sessions don't have different window titles. In that case you'd need to find some other property that differentiates them.
1 Like
I am really not a pro regarding coding or to give correct answers, what I know is that LogicPro has different project names. So each window has a dedicated windows title. But I am not aware, if this is enough to be read by BTT? - the moment where I wished I had invested 1h per week into coding since years hahaha
4.520 alpha should fix the flickering and the auto focus. I haven't checked LogicPro yet. I'll download the trial soon.
1 Like
Will test it soon! Regarding "Trial of Logic" (didn't know they have it) next week they release LogicPro 11. So maybe you wait a bit .
Yes, flickering and auto focus working fine. Great
The FloatingAppNote is showing up each time I start the Mac. Just wondering how to tell it to show up only if the key command is pressed?
Change the visibility here:
It's probably set to show on launch
1 Like
Can't recommended it anymore because I found it non-reliable enough, sadly. Content won't show up anymore, the note field stays empty and my information, my thoughts are lost.
As far as I understand, that preset works with the window name. In my scenario if Safari is open and has 20 tabs, it seems that this is not working?
I know have a quick note on the right bottom corner from the Apple notes. This feels not as smart as BTT/ Andrea's version, but the content stays.
Will gladly return to your preset if I understand clearly what I am mistaken
Just an idea, a possible workaround I am unable to produce as I am to dumb for programming.... well at least now
- each note, each text could be automatically saved after closing the note field in a *.txt file.
- there, each note becomes a header with the window name on it and the date.
So no note is gone, you just open that *.txt and scroll through your notes list.
The preset is just a quick example for a very specific usecase, it would need to be adapted for other needs. E.g. you can make it per app instead of per window.
This is the current (very simple) code of the webview item:
<html>
<head>
<style>
#editableDiv {
width: 100%;
height: 100%;
display: block;
}
#editableDiv:focus {
outline: none;
}
</style>
<script>
async function BTTNotification(note) {
setTimeout(async () => {
let data = JSON.parse(note);
console.log(data.note, data.name);
if (get_string_variable !== undefined) {
console.log(data.note, data.name);
// example to get the currently active app, this works for any BTT variable you define:
if (
data.note == "BTTVariableChanged" &&
(data.name == "BTTActiveAppBundleIdentifier" ||
data.name == "BTTActiveWindowTitle")
) {
let toSave = document.getElementById("editableDiv").innerHTML;
console.log("to save", toSave);
await set_persistent_string_variable({
variable_name:
"currentText" +
(window.bundleIdentifier ? window.bundleIdentifier : "") +
(window.windowTitle ? window.windowTitle : ""),
to: toSave,
});
let bundleIdentifier = await get_string_variable({
variable_name: "BTTActiveAppBundleIdentifier",
});
let windowTitle = await get_string_variable({
variable_name: "BTTActiveWindowTitle",
});
if (!windowTitle) {
windowTitle = await get_string_variable({
variable_name: "windowName",
});
}
let savedContent = await get_string_variable({
variable_name: "currentText" + bundleIdentifier + windowTitle,
});
window.windowTitle = windowTitle;
window.bundleIdentifier = bundleIdentifier;
document.getElementById("editableDiv").innerHTML = savedContent
? savedContent
: "";
}
}
}, 100);
}
</script>
</head>
<body>
<div id="editableDiv" contenteditable></div>
</body>
</html>
It saves the data under this key:
"currentText" + bundleIdentifier + windowTitle
To make it per app instead window, you can change this to
"currentText" + bundleIdentifier
And this:
await set_persistent_string_variable({
variable_name:
"currentText" +
(window.bundleIdentifier ? window.bundleIdentifier : "") +
(window.windowTitle ? window.windowTitle : ""),
to: toSave,
});
to:
await set_persistent_string_variable({
variable_name:
"currentText" +
(window.bundleIdentifier ? window.bundleIdentifier : "")
to: toSave,
});
2 Likes
Copied and will paste& try. Thank you!
I have implemented both changes you suggested for the per-app edit of the code, but it’s not saving the note for each app. The floating menu opens the same saved note for every app. Do you have any other suggestions? The original version of the code didn’t save the note at all, so it’s a step in the right direction.