"Merge Rows" applescript
Michael Esveldt
mesveldt at gmail.com
Wed Oct 19 18:49:40 PDT 2005
This script reveals a scripting limitation I often run up against,
namely styled text in the rows you merge is lost in the merge. Is
this a limitation of the applescript or of OO?
Best,
Michael
On Oct 19, 2005, at 8:17 PM, Brian C. wrote:
> A customer asked for the ability combine several items from the
> same level into one multi-lined entry.
>
> The following AppleScript doesn't do *exactly* what the customer
> was asking for - it doesn't enforce the "from the same level"
> restriction, for example - but it's close. Figured it might be
> useful to some of you out there in the real world, as well.
>
> (The script will work in OO standard if you just trim the
> application name in the first line before saving it in script editor.)
>
> bwc
>
>
> tell front document of application "OmniOutliner Professional"
> set theText to ""
> set theCount to (count of selected rows)
> if theCount < 2 then
> display dialog "You need to select at least two rows to use
> this script." buttons "Cancel" default button "Cancel"
> end if
>
> set theFirstSelected to first item of selected rows
>
> repeat with i from 1 to (theCount - 1)
> set theText to theText & (topic of (item i of selected
> rows)) & "/n"
> end repeat
>
> -- now stick the text of the last row on by hand
> -- without the trailing newline
> set theText to theText & (topic of last item of selected rows)
>
> make new row with properties {topic:theText} at before
> theFirstSelected
> repeat with aRow in selected rows
> delete row id (id of aRow)
> end repeat
> end tell
>
> _______________________________________________
> OmniOutliner-Users mailing list
> OmniOutliner-Users at omnigroup.com
> http://www.omnigroup.com/mailman/listinfo/omnioutliner-users
>
More information about the OmniOutliner-Users
mailing list