outline view: make new data item (not) at end of… but at a special pos

first sorry for my english I’m not english native speaker

My concern is:
I have an outline view (with 1 item, a group with 3 items, and one item)
I want to create a new item after item 1, and I goggled but didn’t find anything


make new data item at end of data items of the_parent --create
set last data item of the_parent to selectedDataItem

this rocks :slight_smile:

but I want something like that, and I don’t find what is the syntax :frowning:

make new data item after data item 1 of the_parent --create
set data item 2 of the_parent to selectedDataItem

PS: my real aim is to unchain an item from a group while keeping its position, or to chain items (while keeping their positions).
But with a make new data item at end., the resulting position of my new item (or group) will always be at the end.

Thanks for your help, I made a lot of tests and I don’t have any idea anymore.

I haven’t done anything with an outline view but there are 2 example projects you can study in /Developer/Examples/AppleScript Studio/… called Outline and Outline Reorder. I’m sure one of them will show you what you need.

hello and thanks for your answer

no hope with this one (it’s just an “how to” make a outline view)

nor with the 2nd one

PS: I use the 2nd one to make my tests
here is my modified version of this project to chain/unchain items by programmation, if you want to try: chain and unchain (=make a subfolder and extract form subfolder) is well done now :), but relative position is not kept :frowning:
here is the .zip project (19KB), take a look if you want to play with outline view (I desactivated drag’n’drop reordering, but add some new codes)

(I hope there will be another reply :D)

Edit: my bad, I didn’t upload the good file, corrected!