View Single Post
Hi,

I am attempting to write a script that moves a selected row from one section to another in the same document (The document has two sections).

I have tried and failed using two possible constructs : the first using the duplicate command - failed attempting to filter based on Ancestor:
Code:
-- copy the checked items
	duplicate (every row of original whose state is checked and has subtopics of it is false and ancestor is first child of original) to end of children of LastRow
original is set to the front document

Next I tried doing a move from within a loop of all the rows in a section:
Code:
repeat with oneRow in rows of first child of original
if (state of oneRow is equal to checked) then
move oneRow of original to the end of children of LastRow
end if
end repeat
LastRow was set using :
Code:
set LastRow to make new child at end of rows of LastSection with properties {topic:dateString}

The first option is the most elegant as the duplication will duplicate all rows in one line of code.
I am unable to fathom the syntax, can anyone help?
best wishes
Simon