The new scrivlnk URL

JJ
JJSlote
Posts: 546
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: NY, USA              Docs in Binder: 10,500+

Thu Sep 17, 2015 6:39 pm Post

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

User avatar
AmberV
Posts: 23795
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Thu Sep 17, 2015 8:33 pm Post

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.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

JJ
JJSlote
Posts: 546
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: NY, USA              Docs in Binder: 10,500+

Fri Sep 18, 2015 1:08 am Post

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

User avatar
AmberV
Posts: 23795
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Fri Sep 18, 2015 2:10 am Post

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.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
garpu
Posts: 2015
Joined: Mon Oct 25, 2010 9:38 pm
Platform: Linux

Fri Sep 18, 2015 2:30 am Post

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.
Slackware-current 64-bit, XFCE