update trash

If I delete items with a do shell command, the items are in trash, but the trash only shows that it is not empty after opening it in the Finder. How can I update the trash?

The shell command to delete items to trash is:
do shell script " mv /Users/yourName/Desktop/a /Users/yourName/.Trash"

I guess the finder app doesn’t know the trash has changed, so it doesn’t know it needs to update. Could you script finder to delete the files. Create a dummy doc and trash it via finder scripting? Not sure if that will work. Or open then close the trash? Those are lame solutions. How about scripting finder.app to update the trash object?

update: Update the display of the specified object(s) to match their on-disk representation

I believe that forces a window to update.

Edit: The content of the window is not the problem, it’s just the icon in the dock that doesn’t change. When you delete something with the Finder, manually or with AppleScript, it somehow changes the icon of the trash. I would think that the Finder also changes the icon back when you empty the trash.