Page 1 of 1

The new scrivlnk URL

Posted: Thu Sep 17, 2015 6:39 pm
by JJSlote
Greetings Team Scrivener

Those who are running the beta may have noticed a new format for Scrivener Links. A scrivlnk:// prefix and hexadecimal codes separated by hyphens have replaced the simple integer DocID. One advantage is that the links can reside entirely in the RTF document, sparing the overhead of a separate Links file for each doc.

The DocID is the root of the destination filename in Windows. But the DocID does not appear to be embedded in the hex codes. This makes the format a bit more vulnerable should the time come when the user has a set of RTF files and no Scrivener to mediate the links, as a link now connects to its destination file neither by name nor by target.

So I'm wondering whether there's a way I'm not seeing to derive the destination DocID from the hex URL. And, if not, whether there might still be a chance at this point to encode the DocID therein.

Thanks -- Jerome

Re: The new scrivlnk URL

Posted: Thu Sep 17, 2015 8:33 pm
by AmberV
The simple sequential numbering system is being phased out to allow for reliable independent editing on mobile devices. This format update is a transitional phase, where serial numbers are still being used for the architecture, but items are also tagged with a UUID in the .scrivx, which is what mobiles will be using entirely.

So to map an internal link to its serial numbered RTF file, you would look up the UUID referred to in the scrivlnk code, search for it in the .scrivx, and that should give you the BinderItem line that has its serial number ID for the RTF file.

Re: The new scrivlnk URL

Posted: Fri Sep 18, 2015 1:08 am
by JJSlote
So these new doc references will become increasingly baked in. Maybe even the next generation of file name. I can see definite advantages to this approach, to go with the mobile compatibility. Scratch Pad ScrivLinks, and docs that can be shared among projects, for example. Thanks, Amber.

Rgds -- Jerome

Re: The new scrivlnk URL

Posted: Fri Sep 18, 2015 2:10 am
by AmberV
Yeah, that's the direction we're going, phasing out the serial numbers entirely. It was a decision not taken lightly. We really like how "friendly" the internal structure is right now, and simple integers are that, while UUIDs are anything but. Fortunately for most people it won't matter a bit, and using global unique IDs is immeasurably safer when it comes to merging what amounts to two different projects together, during sync.

Re: The new scrivlnk URL

Posted: Fri Sep 18, 2015 2:30 am
by garpu
I just discovered the "copy as ToC." My God, where has that feature been all my life? Or when I was writing a dissertation?

OK, I see. "Duplicate" is if you want to make a duplicate document.