On my Mac’s scrivener I have a number of PDF files in the data folder and am able to copy a link of a PDF file and past into a scrivener page. Once synced to Dropbox, I can use the link in iOS scrivener to access the PDF. My question: how can I do the same process in iOS scrivener? I can’t find a way to copy a link to a file in the data folder in order to paste it into a page in the same project. Is this even possible?
You can create any kind of link in Scrivener, but I’m not sure it’s possible to create file system links on iOS. I think it depends on the app where the file is stored. Dropbox would need a URL schema so that you could copy that URL from Dropbox and paste it into Scrivener’s “add link” feature. Opening a link from Scrivener calls on the operating system to open it, so that would work, but only if Dropbox has a URL schema on iOS and handles opening them, and I don’t think it does (but could be wrong).
As Keith said, you’ll need an app that can open your URLs on both platforms, which means file:/// URLs won’t work.
I use BibDesk on the Mac and PocketBib in iOS, which lets me insert x-bdsk:// URLs as links to bibliographic records - these work on both platforms, and in each case it’s one further clock to go from the bibliography manager to the relevant linked PDF.
I’m not sure if there are any PDF readers that offer URL scheme that work on both platforms - maybe PDFPen or PDF Expert? Looking briefly at PDFPen’s URL scheme, it looks like (depending on how your files are organized) you might be able to do a quick find and replace to convert file:/// URLs to pdfpen:/// URLs and back each time you switch platforms. Not the simplest but a possible solution.
Some other apps (offhand) with URL schemes that work the same on Mac and iOS are 2do, Day One, and Pocket. Also I think Evernote (I don’t use it).
(Among those URL scheme that don’t work cross-platform are x-scrivener:// links, the ones created when you link to a document on Scrivener for Mac. I’m hoping this is only a temporary omission since my task management has been built around linking to particular documents within Scrivener … More thoughts here: https://forum.literatureandlatte.com/t/automation-beyond-applescript-which-has-never-been-implemented-anyway/33698/6 )
You can copy a link to a dropbox file:
- Select the file in Dropbox
- Press “Send Link” then “Copy Link” in the Sharing PopUp
- Select some text in Scrivener (optional but avoids pasting the very long ugly dropbox URL)
- Paste the Dropbox url into “Add Link” in Scrivener after deleting the “http:/” at the beginning of the field.
The resulting link will open the document in IOS dropbox or On the web from your Mac.
It’s not an elegant solution, but it does work.
Beautiful job on IOScrivener by the way, Keith. Thanks.
I’m talking about a pdf file that is inside Scrivener (it is in the “data files” folder in Scrivener). I can right click on a file and choose “Copy Document Link” - again this is in Scrivener and then paste it in a Scrivener document (this is the Mac desktop version). I’d like to do the same thing in iOS. This assumes the desired pdf file is already in the Data Files folder, I’m not trying to access some other file in Dropbox.
I can also right click inside a desktop Scrivener document and choose Scrivener Link>Data Files… and then choose a file to get another type of link in the document. Either way works and I can later click on the link in iOS Scrivener (after it has been synced) and view the pdf file.
File system links tend to be that way. Since those sorts of links use paths to address where the link should go, trying to make that scheme cross-platform is likely not possible (though at least macOS and iOS use the same path punctuation, unlike Windows!). These can even break between two different Macs. So a link pointing to /Volumes/MyExternalDrive/Scrivener Projects/Some Major Job/Notes.scriv is going to point nowhere when Notes.scriv is dropped into a sandbox container on an iPhone. The path to Notes.scriv is completely different, but how will a string of text in a hyperlink field know that, or where to look otherwise?
You mention some other stuff that uses URIs to trigger internal actions inside the software. This is a very broad category of stuff by the way. You can use this scheme to make the software quit, for example, or change a preference. There really are no limits, it is just a message in plain-text format that can be routed through the system on click events and such. The stuff you listed all use monolithic central databases to store and track everything. Scrivener uses files. Completely different kind of software, completely different type of external link mechanism (despite the superficial similarities in UI implementation: click and file pops up).
Just so you know, that’s not the method I would recommend for most scenarios. Consider that all of the above is behind the “Copy Document Link” command. You are generating a static URI to an item in your project that can be triggered from everywhere, even from a web page. The downside of that kind of link should be obvious from the above: rename your project and poof all the links to it break—and in your case, all of the links inside of your project break.
For links inside of projects, pointing from one place to another, there is no need at all to use external links. Scrivener Links are internal links, they will never break under normal usage and are much easier to create and work with. There is a whole user interface for working with them.
And by the way, that’s the sort of internal link we support on iOS as well:
- Select some text in your editor (optional, if you skip this step the resulting hyperlink text will be the binder title of the item you link to).
- Tap the Insert button.
- Select “Add Link”.
- Tap on the PDF you want to link to (note you can pull-down on this list and search by file name).
Done, and that will work on all operating systems. No complicated OS level URL routing, fragile path-based addressing, etc.
Hope that helps!
Thanks, it was the link icon in the first row of the iOS keyboard that I didn’t find. Now it all works.
About your discussion above, Amber, I had stopped using the Copy Document Link command when right clicking the pdf file, since the text that was pasted was the “x-scrivener-item:///…” variety, not pretty. I’ve begun using the context menu Scrivener Link>Data Files… when editing a document. This pastes a filename which is more helpful. Perhaps this is, in the end, the same kind of like as the former, but it works for me, for both mac and iPad.
Thanks Amber. I get that the existing scheme for linking from external files to Scrivener for Mac is fragile because it relies on filenames (and I experienced the kind of breakage you describe earlier today when existing links were pointing to projects that I’d love to my Dropbox sync folder…Though it was easily fixed by simply finding and replacing the changed path).
You say Scrivener isn’t relying on a database but if you look at one of the project.scrivx files it looks like there is a unique UUID field there that identifies the project in the binder. Presumably this is being used to generate the internal links. So internally to projects there is something database-like going on. But I also see that getting Scrivener to know which project contains a particular UUID would be a challenge (especially on Mac and Windows where projects could be anywhere on the file system).
I’m not sure what the answer is, but I would really like to see some way to link cross-platform to the contents of a project. I have built a whole revising process around taskpaper (and some omnifocus) files with x-scrivener links which only work on the Mac.
That’s the kind you want to use for cross-references within your project, yes, and these are fully cross-platform compatible, Windows too.
Right, within the confines of a project we have full control (I wouldn’t call it a database, it’s more like a bunch of text files with a master index file, like say the internal technical contents of an ePub). Every item has a unique identifier and internal links use that to establish a stable reference that won’t break. When I said monolithic, I mean in the sense that the software lumps all data you make with it under one umbrella, in one form or another. The data is “managed” you could say. In Scrivener your data goes into discrete containers, projects, each of which you have full control over. You can put one on an encrypted DMG and another in a public access Dropbox folder.
You can’t do that with Evernote—but with Evernote a link to an entry will never break because it doesn’t allow you to do what you can with files. Pros and cons either way, we side with giving you flexibility and ultimate control over your data.
It’s a tough one, maybe the only real practical solution would be to ignore the path and just string match the project name part against the project list and, I suppose, attempt to find the ID from within the first project in your app that matches the name. It sounds a bit messy to me. It might also be confusing (and even annoying) when used from within Scrivener between projects.