No Scrivener Links from QuickRef?

Just tried to create an internal Scrivener link from a QuickRef window. No luck. :frowning:

  1. Selected a word in a table in the QuickRef window to be the link origin.
  2. Right-clicked the selected word to bring up contextual menu.
  3. Selected Scrivener Link from that menu and then chose a document within the project to be the target of the link.

Result: No link visible in the document in the QuickRef window. No link visible in the same document in one of the editors.
I tried the same procedure using a word in a QuickRef window without tables. Same result.

However, if I create the Scrivener link in the same document in the editor, it shows up properly there and in the QuickRef window also.

Hope this hasn’t already been reported. I couldn’t find it with several searches.

This is a wonderful writing program! Many thanks to KB and to your staff.

John Robert
Scrivener 2.02
MBP mid 2010, 10.6.5

Hi,

Many thanks for the kind words, much appreciated!

Hmm, very strange. I just tried this and I got a Scrivener link - but the link appeared after the selected word, which is completely wrong. So there is definitely a bug here. Do you ever get this result? Or does it always fail to create a link?

I’ve added this to the list to investigate for 2.0.3. The behaviour I’m seeing is almost certainly caused by the same bug affecting you, although I’d like to confirm that.

Thanks,
Keith

Okay. This one is totally weird:

In the QR window, I’m able to create a wiki-style link, use the keyboard shortcut on selected text to create a new link (or to link to an existing document), and also select text and turn it into a link through the menu Edit>Scrivener Link. All of these work normally.

However, I get different odd behavior trying to go through the context menu:

Scenario one:

  1. Open a document in the editor, and click inside the document
  2. Open the same document in QR
  3. Use the context menu to create a Scrivener link on selected text in the QR

Result: A link is created with the title of the linked document and added to wherever the cursor is placed in the main editor, rather than linking the selected text.

Scenario two:

  1. Open a document in the editor
  2. Open a different document in the QR without switching the document in the editor and without clicking inside the editor (so either lock the editor or open via View>QuickReference)
  3. Select text in the QR and open the context menu to create a Scrivener Link

Result: Context menu options for Scrivener Links grayed out initially.

  1. Click in editor, then back to QR

Result: The menu is now available. However, adding a link to the selected text does not add the text in that document; it adds a link with the title of the linked document (as in scenario one) to the document open in the editor wherever the cursor is placed.

Scenario three:

  1. Open a document in the editor
  2. Without clicking in the editor, open the same document as a QR
  3. Select text in the QR and open the context menu to create a Scrivener Link

Result: Context menu options for Scrivener Links grayed out initially. Clicking in the editor and then back to the QR will restore the options, but creating a link will do the same as in scenario one.

No console reports with any of this. Using 2.0.2 on OS 10.6.5.

I just opened Scrivener again this evening to try the Scrivener link in a QR window another time. This time I get the same result as MM’s Scenario two: First the Scrivener link contextual menu items are grayed out. Then, after a click in the editor pane and another click back to the QR window, the link that I’m trying to create in the QR window instead shows up where the insertion point was in the editor pane instead. So, no link in the QR window, instead a link with the title of the target document in the editor window.

And this is odd. I cannot undo the link in the wrong window immediately: Undo is grayed out. But I can Undo that ill-placed Scrivener link if I first click in the editor window. So it appears that Scrivener is confused about which window has focus.
Even if I lock the editor pane, I get the same result.

Now that I think about it, I believe that the text thread in the editor window jumped when I tried to create a QR Scrivener link in the incident I reported in my previous post. I didn’t find what what causing that movement, but now I’ll bet it was this insertion of the name of the link target in the editor window that MM identified. But I just didn’t see it because the link color is muted. So, instead of failing to create a link as I thought before, it may be that Scrivener was creating the wrong kind of link in the wrong place instead.

Also like MM, I can create a Scrivener link in the QR window if I use the Edit>Scrivener Link>Draft (or Research, etc.) route. And Scrivener will undo it while the focus is still on the QR window. But Scrivener will not create the very same link using the contextual menu. Instead it reverts to creating a link in the editor window as outlined above.

Finally, I haven’t noticed the links migrating in the QR window as you describe, Keith. Although, oddly enough, I have seen that behavior a number of times in Tinderbox when creating a very similar looking link from selected text in one note window to another note (the target).

John Robert

To clarify about my above post, when the QR and the editor display the same document, the link created via the contextual menu does appear in both the QR and the editor, but it gets inserted as new text (the title of the linked document) wherever the cursor was in the editor. So I suspect this is the same behavior that you both are getting–if it’s a long document and you’re selecting text at the bottom of the document in the QR window but your cursor in the editor is at the top, it will look as though nothing happens when you create the link; you’ll have to scroll back up in the QR window to see it. And if your cursor in the editor happened to be at the end of the word you select in the QR window, then the reference gets added right after the selected word.

Ach, yep, it turns out that the contextual menu code doesn’t know about the QuickReference panels - so it uses the main editor cursor position and settings which obviously leads to strange and erratic behaviour. This is obviously an oversight on my part, but I have just fixed it for 2.0.3. Until then, avoid the contextual menu in QR panels (it won’t do anything irrevocably bad, but you will get this sort of strange behaviour with a few other menu items too). The only items affected will be “Append Selection” down to “Scrivener Link” - everything else will work fine.

Thanks!
Keith

OK, good deal. I’ll look for 2.03.

John Robert