Try this as your inner bit:
Code:
tell front document's quick entry
open
set _task to (make inbox task with properties {name:_name})
tell _task's note to make new file attachment with properties ¬
{file name:_item's POSIX path, embedded:true}
select (leaves whose id is _task's id)
end tell