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

 
Change row to column? Thread Tools Search this Thread Display Modes
Hello,

I have a simple OO-document with just level 1 and level 2 rows. Now I decided that the level 2 rows would work better as columns. What is the easiest way to make that change?

Just to visualize, this is what I have now:

Code:
- Some sample
    - text to
- show what
    - I want
And this is the desired outcome:

Code:
- Some sample        text to
- show what          I want
 
Quote:
Originally Posted by makronym View Post
Hello,
Code:
- Some sample
    - text to
- show what
    - I want
And this is the desired outcome:

Code:
- Some sample        text to
- show what          I want
I would probably back up carefully, place a good copy out of reach, open a working copy of the document, and run this script.

Code:
tell application id "com.omnigroup.OmniOutlinerPro3"
	tell front document
		set oCol to make new column with properties {type:rich text, name:"Moved Children"}
		set strColID to id of oCol
		set refParents to a reference to (rows where level = 1)
		repeat with i from 1 to count of refParents
			tell item i of refParents
				set oChild to first child
				set value of cell id strColID to topic of oChild
				delete oChild
			end tell
		end repeat
	end tell
end tell
 
A word of caution: Rob's script only moves the first level 2 row under each parent and leaves any others behind. Also, if you had any rows indented under one of your level 2 rows, they will be silently dropped from the outline.
 
Thanks a lot, that worked just fine. I can live with the constraints, my document was really that simple.

(Note to self: learn that Apple script thing, it seems essential)
 
Quote:
Originally Posted by makronym View Post
Thanks a lot, that worked just fine. I can live with the constraints, my document was really that simple.

(Note to self: learn that Apple script thing, it seems essential)
It is, especially with Omni applications, which have extensive Applescript support.

First assignment: figure out how to change the script so it handles two or more child rows :-)
 
Quote:
Originally Posted by makronym View Post
my document was really that simple
I'm glad that worked with your data - WhPalmer4's point is a very good one - better to code defensively than to rely on backups.

To skip any rows with more than one child, or with any grandchildren, we could have written something like:

Code:
tell application id "com.omnigroup.OmniOutlinerPro3"
	if (count of documents) < 1 then return
	tell front document
		set oCol to make new column with properties {type:rich text, name:"Moved Children"}
		set strColID to id of oCol
		set lstParents to (rows where (level = 1) and (has subtopics = true))
		repeat with oParent in lstParents
			if (count of children of oParent) < 2 then
				tell oParent
					set oChild to first child
					if has subtopics of oChild = false then
						set value of cell id strColID to topic of oChild
						delete oChild
					end if
				end tell
			end if
		end repeat
	end tell
end tell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Which Column Determines Section HunterBoss OmniOutliner 3 for Mac 3 2011-09-01 09:41 PM
Is it possible to change the outline column ? lxln OmniOutliner 3 for Mac 2 2009-12-30 05:31 PM
Is it possible to change column widths permanently? appenz OmniFocus 1 for Mac 2 2009-10-09 09:40 AM
Change column width? Chrisphelps@me.com OmniFocus 1 for Mac 3 2009-09-01 06:54 AM
Way to change column alignment mims OmniPlan General 2 2006-10-27 07:18 AM


All times are GMT -8. The time now is 03:59 AM.


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