Just as moving a note via action code involves setting a new $Container for that note, moving a note via AppleScript involves specifying the new container. It thus makes sense to first set a reference to the new container and then move the item. In this example, a reference is made to the parent
property (the containing note) of the note referenced by myNote
), then note 'X' is moved into that container:
To return a reference to myNote's container, i.e.
set theContainer to find note in myNote with path "parent"
move note named "X" to theContainer
Note in the first line, the new container is being referenced via the myNote's note properties.
See also—notes linking to here: