How to change file location for .sfm files

Hi, everybody. Is there a way to change the file location where PTXprint expects to find the Bible files in USFM format?

Backstory: we are using Bibledit, not Paratext. I need to print some drafts, and it looks as if PTXprint has more robust printing options, so I installed it on Windows 10 in a VirtualBox virtual machine on my Mac running OS 10.14 (Mojave). Right after launching PTXprint for the first time, it told me Paratext was not installed and then asked for a location for the files. I tried to point PTXprint to a linked folder so it would access the Mac, but that didn’t work. Finally I selected some folder (I no longer recall which one) on the Windows side and continued on.

I have USFM files exported from Bibledit that I can put in any folder needed. Also, from old days when I had Paratext installed, I have a folder on the C: drive of the Windows virtual machine named “My Paratext Projects”. I made a subfolder in it for the Bible I’m working on and put the USFM file for the Gospel of John in it (with .sfm suffix). I want to get PTXprint to “see” that folder. However, in PTXprint 2.1.15, I cannot find any way to change the folder it looks for files in. And … since I read that PTXprint also uses the stylesheet the project uses, do I need to put a copy of it in the same location? Thank you very much for any help you can offer!

Edit: After I posted this, I found this relevant thread in the forum for “Using Paratext 7 or other source for USFM”.)

I tried going to a command prompt in Windows 10 and typing in ptxprint -p. However, it didn’t work. I think I need to change the directory (folder) or something, but I do not know.

Edit 2: I finally figured out how to change the directory, and then discovered that I needed to use ptxprint -p none, not merely ptxprint -p. It worked! Now I’ll see if I can make PTXprint work with the files I have.

There are two ways to use ptxprint -p to access your files. First you need to structure your collections of scripture files like a ParatextProjects directory. This simply means that each collection is stored in a directory (whose name is the project name/code you want to refer to it by) under a common root directory. It is this root directory that is considered the ‘projects’ directory. You can run ptxprint -p path/to/projects/dir and ptxprint will use that in preference to the default it looks up either in its configuration or from ParaTExt.

You can also set an environment variable PTXPRINT_PROJECTSDIR=path/to/projects/dir and save having to use ptxprint -p. Note -p takes a required following parameter.

If you run ptxprint -p none then that magically tells ptxprint to forget all knowledge of where a projects directory may be and to ask you. This also happens if ptxprint has no idea (e.g. you don’t have ParaTExt installed) which is what happened to you. It then remembers that location for subsequent runs of ptxprint with no -p or environment variable.

BTW I use paratext -p multiple times per day.

For windows users, I’ve put some basic how to instructions in the previous post on this issue.

Hi Martin,

I’m having trouble with this. 1) If I build a command line with my Projects Directory (with a project in it), I get a 'script error". 2) If I start PTXPrint with -p none then I get asked for the Projects Directory and then am able to select my project. There after I get a raft of errors like:
My sfm file names are like: GEN.sfm, EXO.sfm etc.

Traceback (most recent call last):
File “ptxprint\”, line 2346, in onProjectChange
File “ptxprint\”, line 2376, in updateProjectSettings
File “ptxprint\”, line 434, in updateProjectSettings
File “ptxprint\”, line 16, in init
File “ptxprint\”, line 30, in parse
File “ptxprint\”, line 127, in inferValues
KeyError: ‘FileNameBookNameForm’

@Ross_Webb It looks like you might be selecting a specific Project folder, whereas it is asking you for the folder one level above that (which holds one or more Projects). When you select the “Projects” folder (equivalent to selecting the “My Paratext 9 Projects” folder) it will automatically fish around in there to see which projects are available and then list them for you to select one.

Hi Mark,

No, In fact I did have a Projects Directory, with a Project inside that directory. PTXPrint did start once I gave it the Projects Directory, but when I selected the sole Project, I got the errors.


I have just confirmed that if you have never previously run PTXprint through the UI to create at least a Default config, then the command-line doesn’t seem to work. I’m not sure if there are plans to change this, or whether that is part of the intentional design.

However, if you’ve created a config (by opening the UI, and printing something once) then the command-line option seems to produce a PDF successfully. Here’s what I used:

C:\Users\Mark>"C:\Program Files\PTXprint\PTXprint.exe" -p "C:/Users/Mark/Downloads/" -P BISLAMA

There are several annoying things going on here:
a) The path to the ptxprint.exe file seems to need Windows \ slashes, whereas the -p path to the data location expects / Linux slashes
b) The terminal doesn’t show any confirmation that something is happening, and you don’t really know if it was successful or not. [We need to find a way of restoring terminal output when NOT running in the UI.]
c) Because of b) you can’t even see what the command-line options are when you use -h

Hi Mark,

Mmm, I couldn’t get your command line string (with changed directories) to work, no matter which way the slashes run! I have previously printed with the UI, so that’s not a problem.

This is the most successful I get using command line -p none

I select the directory…

The UI opens and BISLAMA project is offered…

I click on BISLAMA…

I won’t trouble you any more for my sake on this, Mark. I was trying to get it running for a colleague. He since had more success in getting it running that I have had, so there must be something peculiar in my configuration.

Thanks for the your help,