I recently got the question from a user, how to obtain a finder's scope. Well, I recognized that this is actually not mentioned in the scripting guide yet, although it is part of the initial API ever since.
So accessing the scope is simple, just use the "scope" attribute:
var project = finder.scope;
...
// later
if (project != finder.scope) {
// current finder instance is not anymore the project but something else
throw "Something is rotten in the state of Denmark";
}
Note that this is a read-only property and cannot be set. To create a finder on another scope use the Global object. See also related articles The Global and Finder Part 1.
Happy Scripting
Jan