examine an object with an object

I’m learning inform7, or trying to. I want to use a spy glass to examine a scratch. I have to be holding the spy glass to get a result. so far I’ve had no luck in doing this. Any ideas out there.
P.S is inform 7 a dead language because all the tutorials I find on it are three, four and five years old?

If you want “EXAMINE SCRATCH WITH SPY GLASS” to work, you should make a new action. See section 12.7 of Writing with Inform. It doesn’t matter that you already have an “examine” action; the two-noun version will be a different action.

Examining it with is an action applying to one visible thing and one thing. Understand "examine [something] with [something]" as examining it with.

The “it” shows where the first noun goes when you describe the action–so Inform knows that we’ll be describing the action in our source code as “examining the scratch with the spy glass” rather than “examining with the scratch the spy glass” or something awful like that. “Visible thing” means that the first thing is something we can see, but we don’t have to be able to touch it. “one thing” is actually stricter–we have to be able to touch the second thing.

The Understand statement gives the structure of the command that the player must type in order to evoke this–in this case also “EXAMINE SCRATCH WITH SPY GLASS.” (This should also get you “x scratch with spy glass,” I think, because of the way Inform 7 has automatically defined “x” as a synonym for “examine.”)

Now (as per section 12.9 of Writing with Inform) we have to write some rules so our action does something. First of all, we need to make sure that the player doesn’t try to examine with something that isn’t a spyglass. So we check the “second noun”:

Check examining it with when the second noun is not the spyglass: say "You can hardly look through [the second noun]!" instead.

When the word “instead” appears in a check rule like that, it’ll mean that the rule stops the action. (You can also write “stop the action” on its own line to achieve this.) It can be handy to give the rule a name, which we did with the parenthetical comment.

We also want to make sure the player is holding the spyglass:

Check examining it with when the player does not hold the second noun: say "You have to be holding [the second noun] to look through it!" instead.

Now that we’ve stopped the action when we don’t want it to succeed, we can write rules for what happens when it does succeed. Ordinarily we might write “carry out” rules–but since this action doesn’t actually change anything, only prints a description, we can just go straight to the “report” rules and print something.

Report examining it with when the noun is not the scratch: say "You get a closeup view of [the noun], but you don't notice anything special." Report examining the scratch with the spyglass: say "You see something exciting!"

And there we go! There are some other nuances–you might want to write some rules to stop examining yourself with the spyglass, and to stop examining the spyglass with itself, but this should get you started. And check out chapter 12 of the documentation.

it was going well unil the last part and I got this message.
(Each time Go or Replay is clicked, Inform tries to translate the source text into a working story, and updates this report.)

Problem. You wrote ‘the description of the lock is " it’s bent and has some scratches on it." scratches is part of the lock’ : but this seems to give something a name which contains double-quoted text, which is not allowed. If you do need quotes in a name, one option would be to write something like ‘In the Saloon is ‘Black’ Jacques Bernoulli.’; but this problem message is often caused by an accident in punctuation, in which case you never intended to create an object - you thought that the text ended a sentence because it finished with sentence-ending punctuation, when in fact it didn’t, so that I read the next words as following on.

(It may help to know that I am reading the primary verb here as ‘is’, not ‘is’.)

Because of this problem, the source could not be translated into a working game. (Correct the source text to remove the difficulty and click on Go once again.)

That seems to be a missing quote at the end of the first report rule. Try this:

Report examining it with when the noun is not the scratch: say "You get a closeup view of [the noun], but you don't notice anything special." Report examining the scratch with the spyglass: say "You see something exciting!"

Aw shoot, sorry about that. I did run my code to make sure that it worked, but I made a copy-paste error copying it back.

great work. its working great thanks to the both of you. the instructions you gave were clear and i liked the way you explained why it worked. I’ve seen a few tutorials and that always seems something that’s left out.