Document: Close/Discard not working

Hello,

i've created a 3d atomistic trajectory document called "name.xtd" containing the results of a dynamic simulation. The script seems to be unable to close or delete the file, because the following commands are not working - nothing is happening:

my \$trajectory = \$Documents{"name.xtd"};
\$trajectory->Close;

or

my \$trajectory = \$Documents{"name.xtd"};
\$trajectory->Discard;

or

my \$trajectory = \$Documents{"name.xtd"};
\$trajectory->Delete;

after the delete-command the file is still listed in the project explorer. re-running the delete-command leads to the following error: "The document does not contain a trajectory (function/property "Item") at -e line 13."

but the file is still listed in the project explorer with the result that i'm unable to launch a dynamics simulation using perl script: "Dynamics calculation - The trajectory file '\input.xtd' already exists."

any ideas?

thank you!