Is object deletion handled in different ways by AI?
The script I'm writing keeps track of the number of objects in a particular layer. Whenever I delete any object from that layer with the delete key, Scriptographer throws a not valid error message suggesting I should make use of the isValid() command.
However, if I instead throw said object away by manually draging it from the layer palette down to the trashcan, no such error occur and the script reports the correct number of objects left in the layer.
Is "key shortcut deletion" not registered, in some way, as a means of deleting objects in either AI or Sg?
Also, just how is the isValid() command used?