need help with selecting a particular open document in Mori

Tags ( )

hello, hello:

Let me describe the use case for my applescript and then I'll share my applescript problem.

I typically have multiple Mori documents open at the same time. I use multiple virtual desktops and will frequently be in some other application in a different virtual desktop when I realize I want to write down a quick note in a particular mori document. I started out w/ note-chan. However, note-chan just creates a new entry at the top level of the frontmost document. I'm looking for something more targetted that I can invoke via quicksliver.

so, I started putting together an applescript to lauch an entry called "Scratch" from a particular mori document (that is always open, but not necessarily frontmost).

my applescript currently looks like this:

tell application "Mori"
set current entry to entry named "Scratch" of document named "DocumentA.mori"
end tell

tell application "System Events"
tell process "Mori"
set frontmost to true
tell menu bar 1
tell menu "File"
click menu item "New Note Window"
end tell
end tell
end tell
end tell

if DocumentA.mori was already the frontmost document, then this script works. However, if DocumentB.mori was actually tthe frontmost Mori window, then the script doesn't really do anything.

any applescripters have a tip on how I might more consistently target a particular open Mori document with this sort of applescript?

thanks.

I've changed things so that

I've changed things so that in the next release I think your script will work (setting the current entry at the application level will make the entries document become frontmost in the next version), but I'm not sure how you can easily work around the problem in the meantime.

I was thinking about doing

I was thinking about doing some menu scripting to select the Menu item for a particular document from the Window pull-down menu and then run the rest of the script. I'd just need to figure out how to do partial pattern-matching in applescript since the window name changes everytime the selected entry changes.

Comment viewing options

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