How you want to present this is not hugely clear, but in your webscript you need to get a reference to a document and then everything to do with this is "within" that document object.If you had a document nodeRef in your webscript you could do
document = search.findNode(noderef);
If you had a name or path you would need to do a search which would always return an array of document nodeRefs (even if it only returns a single node it will return an array with one element).Now you can get properties using code like:-
var myprop = document.properties["cm:name"];
subsituting "cm:name" with your property name.If you want to check if a document has an aspect you can use
document.hasAspect("aspectname");
Does this help?Bob Johnson