The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Applescript Automatic Find Thread Tools Search this Thread Display Modes
Basically the way I want to organize my document is to have some nodes as definition nodes. These would be prefixed by a # (e.g. #xyzzy). There will be other nodes in my outline which refer back to xyzzy. I want to have my cursor on xyzzy and automatically have it take me to #xyzzy. Of course there are many other things I want to do but that is the first step. The following is what I've done so far.

set searchText to "xyz"
tell application "OmniOutliner Professional"
(*set searchText to item of value of cell of selected row of document 1
set searchText to "#" & value of cell 2 of selected row of document 1
end tell

(* set x to "a" & "b" --> "ab"

tell application "System Events"
tell process "OmniOutliner Professional"
click menu item "Find..." of menu 1 of menu item "Find" of menu 1 of menu bar item "Edit" of menu bar 1
delay 1
repeat until exists window "Find"
end repeat
set value of text field 1 of group 1 of window "Find" to searchText
click button "Next" of window "Find"
end tell
end tell

If I have my cursor on xyzzy and run this script from Script Editor, this works as I want. Obviously running from script editor is not saving me any keystrokes. I've attached this script to my omni outliner menu. I think it is failing because as soon as I click on the menu item it loses the fact that I was on xyzzy.

First how do I set a cursor in a cell and then have applescript keep that information when I click on the script in the menu. Second how do I attach a shortcut to the menu item.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Layout with Automatic Re-alignment michael.prescott OmniGraffle General 0 2010-03-10 07:27 AM
How about automatic self-updates...? soundsgoodtome OmniFocus 1 for Mac 49 2008-11-21 10:59 AM
automatic back-up not automatic? mollificent OmniFocus 1 for Mac 4 2008-03-25 06:02 AM
Applescript find & replace in OmniOutliner Standard Michael Grinberg OmniOutliner 3 for Mac 0 2008-02-18 07:28 AM

All times are GMT -8. The time now is 12:05 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.