The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   duplicate the above row-- applescript? (http://forums.omnigroup.com/showthread.php?t=262)

steve 2006-04-28 11:45 AM

duplicate the above row-- applescript?
 
Is there a way to duplicate the above row in OO?

I could of course, highlight the line, copy it, hit return, and then paste it. I think in FileMaker Pro cmmnd+ " would duplicate the above line.

Any possible directions? An applescript? A keyboard command I am missing?

Tim Wood 2006-05-01 03:17 PM

This will duplicate the selected rows and put them before the first selected row. It leaves the original selection alone -- wasn't clear if that's what you wanted or whether you wanted the new duplicates to be selected.

Also, this has no error checking of its own, so if you have no document open or no rows selected it'll yield an error or silently do nothing.

[code]
tell application "OmniOutliner Professional"
set MyDoc to front document
set FirstRowID to id of first selected row of MyDoc
set FirstRow to a reference to row id FirstRowID of MyDoc
set MyRowIDs to id of every selected row of MyDoc
repeat with MyRowIndex from 1 to count of MyRowIDs -- force forward loop
set MyRowID to item MyRowIndex of MyRowIDs
duplicate row id MyRowID of MyDoc to before FirstRow
end repeat
end tell
[/code]

steve 2006-05-02 08:18 AM

Thank you so much! This is exactly what I needed.


All times are GMT -8. The time now is 06:43 AM.

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