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 > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
OmniOutliner: Fastest way to set data in rows, columns or blocks? Thread Tools Search this Thread Display Modes
Any tips on the "fastest" way to put values into a document? I currently seem to have to loop through and insert values into one cell at a time like so:

(assume a 5 column document--three added to default)

tell application "OmniOutliner" to tell document 1
set theNewRow to make new row at end
repeat with i from 2 to 5
set the value of cell i of theNewRow to "foobar" & i
end repeat
end tell

My understanding is that you can speed things up by reducing the number of Apple Events so I figure that:

tell application "OmniOutliner" to tell document 1
set theNewRow to make new row at end
set the value of every cell of theNewRow to "foobar"
end tell

is probably faster, but I would also like to see a way to set each cell in the row (or column, or block) to a different value. Is there a way to do this? I'm using oo3.

Thanks in advance,
-N
 
Use "with properties" statements.

See for example Omnifocus2Omnioutliner

or, perhaps more helpfully,

OF2OPML

which builds lists of properties before sending them to OmniOutliner.

Last edited by RobTrew; 2008-10-27 at 08:40 AM..
 
Quote:
Use "with properties" statements. See for example Omnifocus2Omnioutliner or, perhaps more helpfully, OF2OPML which builds lists of properties before sending them to OmniOutliner.
I looked at both these scripts briefly, and they only partially answer the OP's question. You can make a row and populate the "note" and "topic" cells at the same time, but as "column cells" seem to be elements, but not properties, of a row, it doesn't seem like you can populate anything beyond cell 2 using this technique.

So, is there any faster way?

Best, Charles
 
Quote:
Originally Posted by Charles Turner View Post
it doesn't seem like you can populate anything beyond cell 2 using this technique
The columns which can be set through a property list when a row is created are indeed limited to three: State, Topic and Note.

Beyond that, and assuming that all references are fully cached, I would be inclined to test the hypothesis that list assignments extending the following patterns may be a little faster:

Code:
tell application "OmniOutliner Professional"
	set oRow to item 1 of selected rows of front document
	tell oRow
		set {checked, topic, note} to {true, "new title", "new note"}
		tell cells
			set {value of item 3, value of item 4, value of item 5} to {"Surgery", "Thursday, June 11, 2009 00:00:54", "Wednesday, August 12, 2009 12:00:00"}
		end tell
	end tell
end tell

Last edited by RobTrew; 2009-07-28 at 12:59 AM.. Reason: adjusted hypothesis
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
add/delete rows/columns in a table. fantzhi OmniGraffle General 1 2014-04-21 07:46 AM
Filtering Omnioutliner rows by values of columns etc. RobTrew OmniOutliner 3 for Mac 20 2012-11-26 03:32 AM
Styling Rows vs. Columns pierog OmniOutliner 3 for Mac 1 2010-07-15 09:03 AM
what is the fastest way to search tasks based on custom data in AppleScript cope360 OmniPlan Extras 2 2009-07-16 02:57 PM
Is there a way to highlight table rows or columns? johanna OmniGraffle General 2 2009-01-20 01:19 PM


All times are GMT -8. The time now is 11:08 AM.


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