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)
-   -   Can I copy rows without their children? (http://forums.omnigroup.com/showthread.php?t=14688)

Humbro 2009-12-01 07:40 AM

Can I copy rows without their children?
 
I often find myself in a situation where I want to copy a row without getting all the children on the clipboard as well. (Now, for instance, I am preparing a Keynote presentation, and need one slide to be an overview of the main points.) The only way I have found to do this is to mark the text of each row and copy that. That is a bit cumbersome, and means I can't copy multiple rows at one. Is there a smarter way?

whpalmer4 2009-12-02 03:36 PM

The following script will copy only the selected rows (no children, no notes, only the topic column) to the clipboard. The rows do not have to be at the same level in the outline.

[code]
tell application "OmniOutliner Professional"
tell front document
set theRows to get selected rows
end tell
set rowCount to (count of theRows)
if (rowCount is 0) then
display dialog "You must select one or more rows!" buttons "OK"
return
end if

set rowIndex to 1
set clipboardText to ""
repeat rowCount times
set theRow to item rowIndex of theRows
set clipboardText to clipboardText & topic of theRow & "
"
set rowIndex to rowIndex + 1
end repeat
set the clipboard to clipboardText
end tell
[/code]

Humbro 2009-12-03 02:02 AM

Thanks a bunch!

I'm kind of an AppleScript noob, though, and couldn't find anything in the manual or here in the forum on how to use an Applescript in OO3. Can you give me a hint?

whpalmer4 2009-12-07 12:21 PM

Using Applescript with OO is easy, at least if you don't have to figure out how to write Applescript :-)

There's an excellent description of how to set it up over in one of the OmniFocus forums, in [URL="http://forums.omnigroup.com/showthread.php?t=7453"]http://forums.omnigroup.com/showthread.php?t=7453[/URL]

Read Rob's directions very carefully as some things that seem like they don't matter, do! If you get stuck, just post again...

whpalmer4 2009-12-07 12:27 PM

Of course, having said that and rereading the posts in the referenced thread, I see that no one spoke to how to take a script posted as text (such as mine) and get it working. Once you've gotten the script folder created for OmniOutliner, fire up the Script Editor (called Applescript Editor in Snow Leopard) found in the Applications/Applescript folder. You can copy and paste the text of the script in to a new window, and then save as a .scpt file in the script directory for the application.


All times are GMT -8. The time now is 10:51 AM.

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