File opens in Writer instead of Calc

I’ve set my subtitle files (.srt) to open in Calc, and they used to with the import dialog popping up first. That was great. Today, I tried to open one and it opens in Writer instead. This is not the expected behavior by previous experience. Yes, I know I can open it to Calc from within Writer. That’s not what I want to do; extraneous steps.

Does anyone know why this has started happening and how we can fix it?

Open it from within Calc. I assume they are some sort of csv file.

I want to double click the file as I have been doing.

Make file name extensions visible, otherwise you can’t know what you are doing. Then decide if you really want to open this type of file with a spreadsheet program

Yes, I have. I want .srt files to open with Calc. They have the Calc icon. They are set properly. They used to open the way I want them to. Now, they open with Writer after the LO splash screen pops up.

This requires tweaking some OS configuration file and you didn’t mention its name, nor LO version.
But even with configuration patching, you are not guaranteed that Calc will manage the file. LO doesn’t trust file extensions. When it is launched (no matter the procedure), it reads some bits of the file at the beginning and tries to guess what it is. Thus, if contents looks like plain text (different from CSV syntax), the file will be displayed in Writer.

The question is: what did you change in your computer since last successful attempt? OS update? LO upgrade? A change in your files?

Probably just OS or maybe even LO updates. Nothing else has been reconfigured.

The only way I had tweaked anything was to right click > open with > Calc (always)

And we’re still in the blue since we have no idea about your OS nor LO version.

Sorry, I forgot that bit:

Windows 11 Pro 22621.1702
LO: 7.3.2.2 (x64)

I had a look at SRT format description and I don’t see how LO can determine it is some form of tabular data.

Try to modify the OS file association table. I have no experience of this under Windows. I think that right-clicking on your .srt file and Open with… should do the trick. Select the application and tick the “Always open this kind of file” or equivalent.

Screenshot 2023-05-20 065814

Already have done that

The name all uppercase with “~F” suggests it is a very old file coming from DOS or old W$. This was the 8+3 convention at this time. It could then be encoded as some code page xxx, not Unicode. This could disturb LO. Use a text editor to convert to Unicode (under a different name to avoid the ~).

1 Like

Do you know of a way to do that? The instructions I’m seeing are telling me that I should be able to edit the settings while Saving As, but that box is greyed out.

As I told you, I have no experience with W$. My favourite text editor under Linux allows me to choose the character set under which the file should be encoded. I have a menu Tools>Encoding>various_families>specific_character_set. See if you have something similar. Anyway, the character set must be chosen before saving.

@SteveS801 , you might be able to do that with Notepad.

Writer: Select SaveAs first, then change file format from .odt to “Text - select charset” (or similiar wording). This it not the first entry fir text in the list. You will then be asked for the charset.

I don’t see how codepage/encoding could be relevant here…

Ah, but it is. I did exactly that: copy/paste, saved as a txt and renamed into srt and it opens as expected. The question I have is why tho? Obviously, I know what to do next time I run into the issue, but can’t it just open with the program I tell it to?

Thank you for the help, this worked.

When you open any file using Calc executable - i.e., using C:\Program Files\LibreOffice\program\scalc.exe, - the resulting command line used to open the file will include --calc parameter. This would tell LibreOffice to prefer Calc filters when opening it.

First thing to check in your case is if the file is really associated with the mentioned executable, and not to generic soffice.exe. Don’t trust the icon, it could be anything, including cached image.

  1. Make sure you do not have LibreOffice running, including QuickLaunch. Open Windows Task Manager, and check that there is no soffice processes on the Details tab.
  2. In the Task Manager, enable Command line column: right-click on any column on the Details tab, click on Select columns context menu item, and in the dialog, make sure Command line is checked.

image

  1. Double-click a SRT file, and when it opens, open the Task Manager’s Details tab again, and see what command line is shown for a soffice process: in case your SRT is associated with Calc, the command line would start with a path to scalc.exe, and also there will be --calc parameter somewhere in the end of the command line.

If there is no mentions of calc in the command line, it means that your manual association was somehow modified. Re-associate your SRTs to Calc again manually.

You may also inspect Windows Registry, to check if the association is correct. The Registry path is HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.SRT\UserChoice, and it should refer to scalc.exe:

3 Likes