Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use taskcoach to create a list of my tasks.

The data I entered was saved, say, in tasks.tsk on my Desktop. Internally, this is an XML file of specific structure.

Now whenever I open it, it opens in my text editor, like any other XML.

I've tried changing extension to .task and .my_tasks, but associated program is the still the editor.

After googling and reading forums, I've right-clicked the file, and in Properties -> Open With chose TaskCoach.

The file opens in TaskCoach, but any other .XML file gets opened with TaskCoach too!

Q: How do I make ubuntu open .task files in TaskCoach while preserving association .xml -> editor?

share|improve this question
    
Just a suggestion, could you re-associate .xml with gedit and see if it helps. –  Amey Jah Aug 3 '11 at 16:48
    
@Amey tried that. Before I introduced the new mime-type the association was the same, regardless of .xml or .task or .tsk extension. –  modosansreves Aug 4 '11 at 13:08

3 Answers 3

up vote 7 down vote accepted

Rename the file you have as anything.task (where anything is something suitably descriptive.)

First you need to create an XML file with the extension information in it. (If you wish, copy the text below into a new text file and save it as task.xml.)

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/taskcouch">
<comment>TaskCoach File</comment>
<comment xml:lang="bg">Taskcoach</comment>
    <comment xml:lang="cs">Taskcoach</comment>
    <comment xml:lang="de">Taskcoach</comment>
    <comment xml:lang="es">Taskcoach</comment>
    <comment xml:lang="eu">Taskcoach</comment>
    <comment xml:lang="hu">Taskcoach</comment>
    <comment xml:lang="it">Taskcoach</comment>
    <comment xml:lang="ko">Taskcoach</comment>
    <comment xml:lang="nb">Taskcoach</comment>
    <comment xml:lang="nl">Taskcoach</comment>
    <comment xml:lang="nn">Taskcoach</comment>
    <comment xml:lang="sv">Taskcoach</comment>
    <comment xml:lang="uk">Taskcoach</comment>
    <comment xml:lang="vi">Taskcoach</comment>
<glob pattern="*.task"/>
<alias type="application/taskcoach"/>
</mime-type>
</mime-info>

You now need to copy this new file into the folder /usr/share/mime/packages using sudo. Once that is done, run

sudo update-mime-database /usr/share/mime

Now, open your file manager and right-click on anything.task and select taskcoach as the default program with the open with option in the context menu.

Job done. All .task files will now open with taskcoach!

share|improve this answer
    
NB You will need to be admin or root to cp file to /packages –  Christopher Stansbury Aug 3 '11 at 17:45
1  
I tried doing this for an application installed in my home folder and it doesn't work. I changed the task.xml file above accordingly, copied it to /usr/share/mime/packages and ran sudo update-mime-database /usr/share/mime. Tried logging out and in again to no avail. –  To Do Jan 23 '13 at 10:00

Quoting:

The file opens in TaskCoach, but any other .XML file gets opened with TaskCoach too!

That happens because they're all the same MIME type. (application/xml)

If you want TaskCoach files to be treated differently from other XML files, you need to configure a new MIME type for them.

I've never done that before, but it looks like Gnome has pretty good documentation on how to do it.

share|improve this answer

If you don't want to mess around too much manually, assoGiate is the GUI tool of your choice. See here for further information.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.