Help with file extensions

Ubuntu Support Template

Ubuntu Version:26.04

Desktop Environment (if applicable):
GNOME extensions

Problem Description:

I have been able to set up an extension to open the appropriate app and load the file with said extension. At first I was only able to get the file to load if the application was already open. Now, if the app is closed, it will open and load the data file, but if the app is already open the file won’t load.

What I’ve Tried:I used mimetype and .desktop files. I am not 100% sure which I used as I was following several pages and it seemed to work so I didn’t go back for a few days and now don’t remember exactly which I used.

Is there a difference in how you set an extension for if the app is open or closed? Does it matter if the file is opened in a browser to “open using…”?

Bob

You should be more specific on what you are attempting to do, for example what app(s) are you trying to use . You’ve just given a good use case for taking notes. Post more details and you should get help.

1 Like

The extension is .ofx. One of the changes I made, allowed me to double click on an ofx and if the application was open it would load the file and if I double clicked on another it too would load. Now I got it so that it will open the app and load, but if I double click on another, it will not load unless I shut the app down and double click on it again.

Bob

Which application ?

Please give the volunteers enough hints, else it will be hard to help you…

4 Likes

Just a general question… I know these functions are set with The mime type database and an xml file to create a mime type and a desktop database with a .desktop file to associate the mime type with the application. My question is, are there different settings, or tools to make a file of mime type X load in an application vs, Open the application and load the file of type X?

I am asking in general terms because I have a couple different cases where I may want/need to do this.

Bob

Oh, so this is not about GNOME extensions; it’s about file extensions and changing which program opens them when clicking on specific file types, right? I think this should explain how to do that:
https://askubuntu.com/questions/90214/how-do-i-set-the-default-program

This program is run from an SH prompt, If I recall correctly, It does not show up in the applications list. But yes, trying to get the file extension .ofx to open my app and load the .ofx file that I double clicked on. At one point I could double click on files if the app was open. Now I can get the app to open and load the file by double clicking but when I try to double click any more, nothing.

Are these Open Financial Exchange files? I am just asking. Do you have the relevant applications installed? If these are Open Financial Exchange files then this link may help.

How to import an ofx file into relevant applications

You should be able to just right-click the file in the file manager app and select the Open with ... sub-menu, there is a latch / checkbox to “Always use this for file type”.

yes and Moneydance doesn’t show up in the app manager so I can’t just choose it and tell it to always use this app.

Bob

I am asking questions to get clarity. Please do not assume I know answers.

When you installed Moneydance did it install a desktop icon? From what I have been reading the Files> “associate with action” cross-references the MIME type with a desktop file (.desktop). These can be found in /usr/share/applications. My Ubuntu 24.04 does not have a /.local folder.

I am getting my information from Google AI. Here is the full content that may help. May be others can advise further.

Ubuntu uses MIME types (e.g., text/plain or image/jpeg) rather than raw file extensions to associate files with applications. The system maps file extensions to a specific MIME type, which is then mapped to a list of applications capable of opening it. [1, 2]

This association process works via the following chain and tools:

  1. The Association Chain
  • Extension to MIME: The system checks the file extension against a global registry to identify its MIME type.
  • MIME to Application: The MIME type is cross-referenced with .desktop files (found in /usr/share/applications or ~/.local/share/applications). These configuration files declare which MIME types an application can handle. [1, 2, 3]
  1. How to Manage File Associations

You can change the default application for a specific file type using either the graphical interface or the command line. [1, 2, 3]

Method A: Graphical User Interface (GNOME Files)

  1. Right-click the file you want to associate and select Properties.
  2. Navigate to the Open With tab.
  3. Select the application you want to use from the list.
  4. Click Set as default. [1, 2]

Method B: Command Line (XDG Utilities)
You can use the xdg-mime tool to query or set the default application for a specific MIME type directly from the terminal. [1]

  • To check the current default application for a file type:

bash

xdg-mime query default text/plain

Use code with caution.

  • To change the default application (you must use the application’s .desktop file name):

bash

xdg-mime default gedit.desktop text/plain

Use code with caution.

For more in-depth desktop management and configuration standards, you can check the freedesktop.org Shared MIME Info Specification. [1]

P.S. I am thinking that you may have to write your own .desktop file for Moneydance.

Regards