View Single Post
Not sure that I've quite grasped the balance between OmniOutliner and OmniFocus questions here, but in OmniOutliner you could experiment on dummy data with some variant of code like this, which re-groups rows into sub-groups which have the same value in a particular column.

Don't try this on real data until you have got a good sense of what it does, and made a number of backups. Prepare also to try undoing changes with Cmd Z.

Code:
-- 	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-- 	"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
-- 	THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
-- 	IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 
-- 	ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- 	 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-- 	 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
-- 	 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-- 	 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-- MAKE SURE YOU HAVE BACKED UP YOUR DATA BEFORE YOU EXPERIMENT WITH THIS ROUGH DRAFT
-- *NOT* INTENDED FOR USE IN PRODUCTION CONTEXTS ...

property pTitle : "Reorganize document"
property pVer : "0.1"

tell application id "OOut"
	activate
	tell front document
		-- Get a list of non-note column names
		set lstCols to (name of columns)
		if item 1 of lstCols = "" then set lstCols to items 2 thru -1 of lstCols
		if lstCols = {} then return
		
		-- Choose the columns under whose values the rows are to be reorganized
		set strFirst to item 1 of lstCols
		set varChoice to choose from list lstCols with prompt "Column(s):" default items {strFirst} with title pTitle & "    " & pVer
		if varChoice is false then return
		
		-- Prepare a list of references to the selected columns
		set lstCols to varChoice
		repeat with i from 1 to length of lstCols
			set strCol to item i of lstCols
			set item i of lstCols to (column strCol)
		end repeat
		
		-- REORGANIZE THE DOCUMENT !!!
		-- PREPARE TO UNDO WITH CMD Z
		organize rows by lstCols under it without prune
	end tell
end tell

Last edited by RobTrew; 2012-01-19 at 02:47 PM..