Make Link for local files

I use Scrivener for organizing my research progress

Most of my writing has pdf links (local path) and it looks like the following.
file:///users/name/Docuements/foldername/foldername/foldername/foldername/xx.pdf

Is there any way to make it shorter?, something like
file:///xx.pdf (doesn’t work without full path)

I save all my pdf files in the same directory where Scrivener files are located.

Or

is there any way to select a text and link (via Scrivener link) to a Project/Document reference which is already in Scrivener (inspector of Scrivener)?

To your first question, the path might work like this:
[file://./xx.pdf](file://./xx.pdf)

Since Mac os X is working on top of a Unix core, I’m pretty sure that the universal “this directory” shortcut of a period will work as a substitute for the full path if Scrivener refers to the directory where it’s projects are as the current directory. If that doesn’t work, try:
[file://…/xx.pdf](file://…/xx.pdf)
which is the next directory down. This might be necessary as Scrivener might consider the current working directory to be inside of the project itself.

I’m not entirely sure I understand the second part. Are you trying to link to a specific passage inside of a document that has been imported into Scrivener?

Actually a double-dot refers to the the directory up the chain, so that wouldn’t help you out. If you are trying to link to something inside the Scrivener project, “file://./project_name.scriv/some.pdf” is what you want, but I think from the description, you are storing the PDFs with the project file—at the same level. The first example of using just a dot would be your best bet.

Actually, I think the main problem here is that the shared workspace used to open files (Cocoa’s NSWorkspace object) only takes full paths, and Scrivener doesn’t try and resolve any paths that aren’t full. To do this, Scrivener would have to try to determine whether the path provided is full or only partial, and if only partial provide the rest of the path from the current location of the project - but working out whether a path is full or partial is actually rather complicated.

All the best,
Keith

Yes, I wondered about that, I’m not even sure if the URI protocol supports relative referencing like you can on a command line. URLs for example, do not allow constructs like “http://…/img/this.jpg” (at least I’m pretty sure of that). To do a relative link you just use “…/img/this.jpg”. That nomenclature wouldn’t work in this context because it requires a protocol, the file:// part, to work.

URL/I sintax is www/site/product/…/image/logo.jpg.

If you use the http headers plugin for firefox or even the developer tools for Safari you will be able to see the browser actually construct the full URL when submitting the request to the server.

Yes that was geek speak. If you don’t get it don’t worry about it just sigh and go on with life in glorious innocence.