Sync note pane continiously to external editor

Tags ( )

This script syncs Mori's note pane continiously with TextEdit. An obvious modification should work with any scriptable text editor (textmate, bbedit, etc...) Be warned though its an infinite loop. You should probably run it from somewhere where you can kill it. ALthough I think closing the document generated in TextEdit should kick it out.

tell application "Mori"
tell application "TextEdit"
activate
set D to make new document
end tell

tell front document
repeat
set e to current entry
set e_text to note of e
tell application "TextEdit"
set name of D to name of e
set text of D to e_text
end tell
repeat while current entry is e
set note of e to text of D
end repeat
end repeat
end tell
end tell

Version: .01

That's going to peg the processor

It's a good first attempt, but that loop that will peg the processor at 100% utilization, causing the system to slow down and laptops to heat up. If you're going to poll something repeatedly, you need to sleep or wait in the body of your polling loop.

I thought that too

It didn't seem to have any horrendous affect on my system. Although I should say I don't actually use this script, since I mostly edit my notes in textmate. One could put a delay in.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.