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

 
INControl Functionality with Applescript? Thread Tools Search this Thread Display Modes
Hello,

I have been looking at OmniOutliner and was trying to figure out if it had the ability to easily filter by a column, which it does not seem to natively do. INControl used to do this, which made it easy to filter items by date or by other category for quick reference. This was especially useful if creating an outline of to-do tasks.

I was looking for a way to achieve this through Applescript or perhaps even Automator. I haven't looked much into what is available as far as funciton calls for either of these, but I was hoping someone might be able to point me in the right direction, or know of something pre-existing that would allow me to do this. Thanks.
 
Filtering isn't possible in OO3, but it's a feature planned for OO4. I believe the only way you could simulate this with AppleScript is by copying all the items that meet your criteria to a new document.
 
Derek,

Can you provide an example of a script that would do that. I'd like to be able to copy the contents of items where an assigned column was assigned to a certain person. But I want all the other columns copied.

Thanks in Advance,

George
 
Are you wondering how to set the data in additional columns? Or are you looking for a script that takes a blank document and adds the columns in?

If you're copying to a document that already has the columns set up, all you need to do so set column cell is something like:
set value of cell "columName" of theRow to myData

to add a column in you can do:
make new column with properties {name:"new column"}
 
Quote:
Originally Posted by DerekM
Or are you looking for a script that takes a blank document and adds the columns in?
Close :)

Actually, I'd like to find any row that has a column set to a particular persons name and then copy those rows to a new blank document.

Does that make sense?
 
So here's a rough script:

tell application "OmniOutliner Professional"
set sourceDoc to front document
set destDoc to (make new document)

set columnList to columns of sourceDoc
set columnCount to count of columnList

repeat with i from 3 to columnCount -- starts at 3 to account for the note (#1) and topic (#2) column
tell destDoc
make new column with properties {name:name of item i of columnList as string}
end tell
end repeat

tell sourceDoc
repeat with myRow in every row
if value of cell "Topic" of myRow contains "find me" then
set value of cell "Topic" of (make new row at end of destDoc) to value of cell "Topic" of myRow
repeat with j from 3 to columnCount
set value of cell j of last row of destDoc to value of cell j of myRow
end repeat
end if
end repeat
end tell
end tell

This will always make a new document when run and it doesn't take into account column types
 
Thanks Derek,

The script was very useful. I had "number" type columns so I had to make a few changes. I also tried to preserve the indenting, but note that all the parents of the "findme" row should also match, or else indenting will fail.

Code:
tell application "OmniOutliner Professional"
	set sourceDoc to front document
	set destDoc to (make new document)
	
	set columnList to columns of sourceDoc
	set columnCount to count of columnList
	
	repeat with i from 3 to columnCount -- starts at 3 to account for the note (#1) and topic (#2) column
		tell destDoc
			set newMe to (make new column with properties {name:name of item i of columnList as string})
			if the type of item i of columnList as text is "number" then
				set the properties of newMe to {type:number}
			end if
		end tell
	end repeat
	
	tell sourceDoc
		repeat with myRow in every row
			if value of cell "Topic" of myRow contains "findme" then
				set value of cell "Topic" of (make new row at end of destDoc) to value of cell "Topic" of myRow
				
				-- copy the indenting from the sourceDoc
				set indentLevel to the level of myRow
				if indentLevel is greater than 1 then
					repeat with remainingIndents from 2 to indentLevel
						indent the last row of destDoc
					end repeat
				end if
				
				repeat with j from 3 to columnCount
					set value of cell j of last row of destDoc to value of cell j of myRow
				end repeat
			end if
		end repeat
	end tell
end tell

--This will always make a new document when run and it doesn't take into account column formatting
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search Functionality? juicywaterhouse OmniFocus 2 for Mac (Private Test) 2 2013-04-30 05:10 PM
Lists Functionality dwilliamhood OmniGraffle General 7 2012-09-11 06:01 PM
Value versus functionality IvorM OmniOutliner for iPad 4 2011-05-15 08:24 AM
Calendar functionality jasong OmniFocus 1 for Mac 16 2009-12-05 05:39 AM
numbering functionality jb3osu OmniOutliner 3 for Mac 0 2006-12-28 09:31 AM


All times are GMT -8. The time now is 06:36 PM.


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