Starting two documents from the command line

Post Reply
gor1515
Posts: 9
Joined: Sun Nov 11, 2018 11:17 pm

Starting two documents from the command line

Post by gor1515 »

PROBLEM STATEMENT

I do most of my work in the command-line environment. In Windows, I start TextMaker sessions via the following batch file:

call start C:\"Program Files"\"SoftMaker Office 2018"\TextMaker.exe %1

The problem arises when I try to open two documents which are in two separate directories. I go to directory A and start a session with a document there, then I go to directory B and try to edit a file there. TextMaker automatically assumes that both files are in the same directory, and so it tells me that the second document is not found. In other words, it ignores my current directory.

I found an imperfect solution by modifying my batch file to include '%cd%', as follows:

call start /newwindow C:\"Program Files"\"SoftMaker Office 2018"\TextMaker.exe %cd%\%1

This works, unless I want to provide TextMaker a full path to the document to be edited. True, I can add some logic to use '%cd%' only when a full path is not provided, but I would prefer a more elegant solution.

SOLUTION TO ANOTHER PROBLEM

When I edit two documents, I need them both to be open in separate windows. However, by default they start in the same window with two tabs. When I start them from within TextMaker, I can click on 'New program window' to create two separate windows, but when I start them from the command line, as I normally do, they come up in the same window with two tabs.

I was able to circumvent this problem by adding '/newwindow' to my startup batch file, which now looks like this:

call start /newwindow C:\"Program Files"\"SoftMaker Office 2018"\TextMaker.exe %cd%\%1

If this solution has already been pointed out, I tip my hat to the original contributor.
miguel-c
SoftMaker Team
SoftMaker Team
Posts: 1233
Joined: Wed Jun 05, 2019 12:02 pm

Re: Starting two documents from the command line

Post by miguel-c »

Thank you for your contribution!
Post Reply

Return to “TextMaker 2018 for Windows”