When I say "lowriter foo.txt" and foo.txt does not exist, it pops up a box titled Error with one button saying "/home/martin/foo.txt does not exist. [OK]" and when you click it, and it exits 0, as it a one-button dialogue (a no no in any GUI) weren't enough of an insult. Not [OK] :) What I expected was that it should open a new empty document that saves to foo.txt when I Ctrl-S or quit. M
*** Bug 159881 has been marked as a duplicate of this bug. ***
But what if you want to open foo.txt but mistakenly type fu.txt? Some hints on how to achieve your goal in this thread https://ask.libreoffice.org/t/how-to-create-empty-libreoffice-file-in-a-current-directory-on-the-command-line/32789 and probably others too. If we need to create a file it should be per command line switch. But isn't the above enough?
> what if you want to open foo.txt but mistakenly type fu.txt? Then it will open a blank document called fu.txt and the careless user will figure out they typed it wrong > Some hints on how to achieve your goal in this thread I've been using text editors and word processors from the command line for 40 years, and they have all created an empty file of the requested name, which is why I expected lowriter to do the same. If libreoffice wants to be bizarre and awkward, apparently with no reason, I guess it can continue to be so. Yes, I do know how to create an empty text file. Not an empty ODT though, and telling me to keep an empty ODT document handy in case I want another one is bordeding on folly.
(In reply to Martin Guy from comment #3) > text editors and word processors from the command line... > they have all created an empty file of the requested name Maybe, but there are probably opposite example too. Thinking of tar. Mike, what do you think about a command line switch to create a document? I think it should not overwrite existing documents, at least when not forced to.
An option to create a new document, without actually writing to disk, but which would (try to) save to that name if saved from the GUI, looks ~reasonable. Then, special handling would be needed for other tasks like converting, printing, etc. IMO, not worth the effort, but up to an interested developer.
Thanks for taking the idea seriously. An option to create a new file would be another "libreoffice does it differently from every other word processor" while I'm talking about the principle of least surprise for end users.
*** This bug has been marked as a duplicate of bug 40227 ***
Note that it is completely incorrect that "every other word processor" does that. One single word processor that is the most used in the world (MS Word) doesn't. Running something like > "C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE" c:\nonexistentDoc.docx gives an error dialog telling > Sorry, we couldn't find your file. Was it moved, renamed, or deleted?
@Mike: :D I didn't know that - I didn't even know you *could* launch Word from the command line and I doubt the devs thought any user ever would. Before LO, it must have been the only WP in the world to have that defectXXXXXXcharacteristic and I'm not sure LOWriter should imitate MSWord just to imitate MSWord. I had a quick look at making a patch but couldn't see immediately where to act. It seems like it would be a fairly simple change for someone who already knows the code base, but if it's difficult for some lowriter-internal reason, don't bother.
(In reply to Martin Guy from comment #9) > It seems like it would be a fairly simple change... Code pointer in bug 40227 comment 9.
Additional code pointer could be the MediaDescriptor service [1], which has SuggestedSaveAsDir and SuggestedSaveAsName members. So your command line option could set them, or even its URL - the latter would skip the dialogs in case of direct Save. [1] https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1document_1_1MediaDescriptor.html
I just say "lowriter" then "Save As..." Resolved. They only have to come here.