Does Scrivener take any Command Line parameters?

I have a number of different projects in Scrivener. It would be convenient for me to be able to link to these from other programs. There is a mechanism called a ‘universal link’ which some programs use where the link specifies the exact file and place within that file which the program is to open. Thus I can link to a specific E-mail or appointment within my E-mail program. The E-mail program generates the link itself and I just have to paste it into a hyperlink within another program.

Scrivener supports universal links to other programs but I want to know if there is any way to link in to a specific project or document within a project from another program?

If Scrivener can take a command line parameter telling it to open a specific project then it would not be too difficult to construct such a link.

I have read the documentation but have not found any reference to command line parameters and so far all my experiments have failed.

Does Scrivener have such a facility?

No, there’s not a way to do this at the moment, but it is on our list for the next major upgrade, so you’ll be able to link to a document within the project with a path that will automatically open the project, if it’s not already open, and load the specified document.

Was this feature ever added to Scrivener? So far I can only find a command line option to open with a particular Scrivener project, but not with a particular document within the project.

If Scrivener is the default app for opening a project (which it is), I suspect open followed by the filename is all the command line you need. Or maybe you need open -a "Scrivener.exe" followed by the filename.

how to open files

You can get the link to a specific item within a Scrivener project for use from outside the project by selecting the item in the binder and choosing Edit ▸ Copy Special ▸ Copy Document as External Link (or Copy Document Link in the context menu). That can be used in other applications to open the project in Scrivener with the particular item loaded, and you can further add attributes to the link to determine which editor the document opens in following the instructions in the Advanced External URL Options of §10.1.6 in the user manual. (Without this specified, the document will load according to the setting for opening clicked document links in the Behaviors tab of Options.)

For the command line, you can pass this link to Scrivener to open the project with the specified document loaded (including optional attributes), e.g. Scrivener.exe "x-scrivener-item://C:/Users/MM/Documents/MyProject.scriv?id=22B44FE1-11D3-4157-B891-F72B9D982D24&view=qr" to open the document in the Quick Reference window.

Excellent. Thank you!

1 Like