The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   AppleScript move command (http://forums.omnigroup.com/showthread.php?t=23130)

bholveck 2012-01-05 01:32 AM

AppleScript move command
 
<UPDATE> I've created the following thread in the Developper section which contains the same question:
[url]http://forums.omnigroup.com/showthread.php?t=23131[/url]


Hi,

I just wrote a piece of AppleScript which moves some rows to a subsection.
I wanted to write minimum stuff, using the move command, but it appears that if I use it, the rows are only deleted, and not copied to where I want.
So, as a workaround, I had to first duplicate them, and then delete them.

Here's an example of what I've done:

[CODE]
duplicate (every child of theRow whose state is checked) to end of children of oDoneSection
delete (every child of theRow whose state is checked)
[/CODE]

Here's what I wanted to write (which should basically do the same):
[CODE]
move (every child of theRow whose state is checked) to end of children of oDoneSection
[/CODE]

Has anyone experienced trouble with the move command??

Thanks,
Bertrand

RobTrew 2012-01-05 06:08 AM

I find that this works:

[CODE]tell application id "OOut"
tell front document
set {rowList, rowDone} to {child 1, child 2}

set refDone to a reference to (children of rowList where state is checked)
move refDone to end of children of rowDone

end tell
end tell[/CODE]

bholveck 2012-01-18 10:25 AM

Thanks Rob,
I don't really understand why applying the move on a reference works better.

It seems like this is helping the internal events sequence of a move not messing with the data.

At least I've learned something new!

Bertrand

RobTrew 2012-01-19 02:55 PM

Well, the reference is a pointer to the thing itself, rather than the address of a copy.

Reminds me of that choice (often quite puzzling at 6am, I find) between brushing one's teeth and trying to brush the reflected teeth in the mirror ...


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

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