Moving rows into notes?
Daniel Flatin
dflatin at rcn.com
Sat Jan 6 15:24:42 PST 2007
On Jan 6, 2007, at 04:50, Doug Lerner wrote:
> I created 7 level-two rows for an item and then realized they would
> have been better off as all part of the inline note for the parent.
> I cut-and-pasted each row into the parent note and then deleted the
> 7 level-two rows.
>
> Is there an easier way to consolidate multiple rows into one row or
> to accomplish what I did?
Here is my attempt at a script to do just this. Deleting the selected
rows is a bit cumbersome, so if anyone has any insight into a more
elegant approach I would appreciate it. As it is, this method is
derived from a script by Curt Clifton which was posted about a year ago.
-- begin script
-- Concatenate the topic text of the selected rows separated by carriage
-- returns and place the text in the note field of the parent row. No
-- attempt is made to check for a hierarchical relationship between
-- selected rows.
property mark : "delete"
-- Generates a random column name for use in marking rows that shouldn't
-- appear in the final document.
set markerColumnName to do shell script "jot -c 16 a z | rs -T -g0"
tell application "OmniOutliner Professional"
tell front document
-- Creates a column for marking rows
make new column at after last column with properties
{name:markerColumnName}
set theRows to selected rows
set theParent to parent of (first item of theRows)
set noteText to note of theParent
repeat with theRow in theRows
tell theRow
if (noteText is not "") then
set noteText to noteText & return & topic
else
-- skip empty lines
set noteText to topic
end if
set value of cell markerColumnName of theRow to mark
end tell
end repeat
set note of theParent to noteText
delete (every row whose value of cell markerColumnName is mark)
-- Clean up
delete column markerColumnName
end tell
end tell
-- end script
Dan
More information about the OmniOutliner-Users
mailing list