How to sync TextEdit (or other file on Mac) and Apple Notes pages?

This is an off-the-wall question, which may not have a simple answer, but it has occurred to me multiple times over years that it would be really useful to be able to have a TextEdit file (or possibly some other app) saved in my specific, working project folder and to be able to sync that with an Apple Notes page that would be in my shared Projects folder in Notes, accessible on my iPhone.

I suppose a file in the working project folder that I open and it automatically opens the right page in Notes would do. I just really hate having to navigate the Notes hierarchy to find things and the convenience of automatic sync between my laptop and my phone is compelling.

Any ideas?

Reading the text file is fairly straightforwrd, so I won’t go into that here. But @_jims wrote a fantastic macro to open and Float Specified Apple Notes that I have been using daily for a year and a half, and that might put you on the right track for opening a specific note. Check it out and see if it is useful.

-Chris

1 Like

Sounds like a good starting point. I'll check it out. Thank you very much!

The more I think about it, simply being able to open a specific note by double clicking on an exectuable file in a specific folder, so I could have lots of notes that are specific to lots of folders, that would probably do the trick. That means I'm not really needing to synch files like I originally asked about. I had presumed a more complicated way to address my real problem.

So now my task is to automate running that "Float Specifice Apple Notes" macro triggered by a shell script. Somehow I'll need to either embed the name of the Note or feed the name of the folder to the script or to the macro. I guess that depends on whether I want there to only be one Notes page per Mac folder or might a Mac folder have links to open multiple different Notes.

I'm imagining a use case like this: In my ~/Personal/Vehicles/Prius folder on my Mac I have an executable file called Prius Mechanic Notes.sh or whatever suffix is appropriate. I double click that and it opens the right Note embedded in whatever folder it's in within the Notes app, probably something like Vehicles/Prius. I maked notes of my questions there, on my laptop, while I'm planning my trip to the mechanoic. Then when I'm at the mechanic, I use Notes on my phone to makes notes about our conversation and his recommendations. When I'm back at my desk I can open those notes from the Vehicles/Prius folder, without having to navigate the Notes app to get there.

There are multiple ways available to automatically generate a note-opening script whenever and wherever I want it, and I don't immediately see a path that is obviously easiest. I'll start by playing around with that Macro and triggering it with a manually created script, to see what's really involved. Any suggestions come to mind?

Any tips on running a KBM macro from a shell script? I know it can be done by using the Trigger By Shell Script and copying one of the suggested shell commands that comes up, which basically are shell commands to run AppleScript to "tell application "Keyboard Maestro Engine" to do script "..." with parameter "..."". What I'm asking for is any caveats, tricks, tips, or gotchas in doing that.

I just had an idea. There's a shell variable that is the name of the current file being executed. If that becomes the variable that is passed to @_jims's script, then name of the executable file would match the name of the note and the correspondence is automatic, with the same script being used in all cases and the only change needed is a change of filename, nothing embedded into the script. I'm liking this idea a lot.

Hi, @cdthomer. I've returned after several days away from the forum.

Thanks for pointing @August to that macro. After reading his reply, Float Specified Apple Notes could certainly be used, but as you'll see in my reply to him, there is a cleaner way to accomplish his goal using another macro that I have shared named Note Picker. As an Apple Notes user, you too might find it useful.

Thanks again!

2 Likes

Hi, @August. I suggest you check out the macro Note Picker. It can be used in two modes. I created Mode 2 to use the macro from Alfred, but after reading your post above I added an example that uses this mode directly from a shell script. I suspect that you'll want to make some adjustments, but this example might give you somewhere to start.

1 Like

Thanks @_jims !

Am I correct that you published that macro just nine days before I asked my question? Now I’m curious about timing. How long did it take you to write it?

Hi, @August.

Yes. But I did add the second Mode 2 example after you asked your question.

Oh, maybe 4 or 5 hours.

My original thought was to modify Float Specified Apple Notes but I soon decided it would be better to create a separate macro.

Thank you SO much, @_jims! I think this may do exactly what I wanted, but wasn't exactly asking for (like so many things, right?)

After I get this implemented for myself (which unfortunately has to wait a bit), I'll mark your post as the solution to the OP question.

Thanks again!

1 Like