How do I create a new Ambient Mime filetype
  • Caterpillar
    Caterpillar
    Lastic
    Posts: 37 from 2021/6/7
    So I'm following this tutorial
    https://library.morph.zone/Creating_Ambient_Filetypes

    Under System:Prefs/Ambient/filetypes I made a new subfolder audio and in this folder
    I made a file called ym

    AMTD
    1
    Name YM Chip Register Dump
    Type audio/x-ym
    Match
    PatternHint #?.ym
    End
    End

    Rebooted for good measure but the filetype does not seem to be recognised ?
    I see it listed under audio in the Ambient Mime settigns but when clicking on a file to configure the Filetype actions , filetype is not recognised ?

    Should the file be named x-ym or the Type in the file or am I doing something else wrong ?
  • »18.10.26 - 08:01
    Profile
  • MorphOS Developer
    geit
    Posts: 1101 from 2004/9/23
    Quote:

    Lastic wrote:
    So I'm following this tutorial
    https://library.morph.zone/Creating_Ambient_Filetypes

    Under System:Prefs/Ambient/filetypes I made a new subfolder audio and in this folder
    I made a file called ym

    AMTD
    1
    Name YM Chip Register Dump
    Type audio/x-ym
    Match
    PatternHint #?.ym
    End
    End

    Rebooted for good measure but the filetype does not seem to be recognised ?
    I see it listed under audio in the Ambient Mime settigns but when clicking on a file to configure the Filetype actions , filetype is not recognised ?

    Should the file be named x-ym or the Type in the file or am I doing something else wrong ?


    AFAIR it is not possible and a limitation of Ambient. There were plans to fix this, but currently there is no way.
  • »18.10.26 - 12:51
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12576 from 2003/5/22
    From: Germany
    > AFAIR it is not possible and a limitation of Ambient.
    > There were plans to fix this, but currently there is no way.

    Is this a regression then? The fact that the tutorial from 2017 exists in the MorphOS Library (related discussion) means that it must have been possible back then, and I remember 3rd-party filetype packs from 20 years ago.
  • »18.10.26 - 16:58
    Profile
  • MorphOS Developer
    geit
    Posts: 1101 from 2004/9/23
    Quote:

    Andreas_Wolf wrote:
    > AFAIR it is not possible and a limitation of Ambient.
    > There were plans to fix this, but currently there is no way.

    Is this a regression then? The fact that the tutorial from 2017 exists in the MorphOS Library (related discussion) means that it must have been possible back then, and I remember 3rd-party filetype packs from 20 years ago.


    Yes, but you cannot modify the tree itself.
  • »18.10.26 - 23:47
    Profile
  • Caterpillar
    Caterpillar
    Lastic
    Posts: 37 from 2021/6/7
    To my understanding, am I doing something wrong ?
  • »19.10.26 - 10:28
    Profile
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2221 from 2003/2/24
    From: po-RNO
    Few tips that should make it work:

    1) "Patternhint" alone isn't enough to recognize a file, you should add "Name" line in the Match block (if there's no other way to recognize it):
    Match
    PatternHint #?.ym
    Name #?.ym
    End
    After this you should see Ambient recognizing it when right clicking a ym file and checking the context menu title.

    2) You should define an action for the mimetype immediately after creating the filetype file, either with Ambient Mime settings or with text editor. If you launch Ambient prefs and save them without having any action on the filetype, the custom filetype file will be deleted and it stops working until you re-create the file.

    3) As you define the Type to "audio/x-ym" the filetype file should be named as "x-ym" too, for the clarity at least.
    The wiki based MorphOS Library - Your starting point for MorphOS
    Software and other things made by me
  • »20.10.26 - 11:02
    Profile Visit Website
  • Caterpillar
    Caterpillar
    Lastic
    Posts: 37 from 2021/6/7
    Quote:

    jPV wrote:
    Few tips that should make it work:

    1) "Patternhint" alone isn't enough to recognize a file, you should add "Name" line in the Match block (if there's no other way to recognize it):
    Match
    PatternHint #?.ym
    Name #?.ym
    End
    After this you should see Ambient recognizing it when right clicking a ym file and checking the context menu title.

    2) You should define an action for the mimetype immediately after creating the filetype file, either with Ambient Mime settings or with text editor. If you launch Ambient prefs and save them without having any action on the filetype, the custom filetype file will be deleted and it stops working until you re-create the file.

    3) As you define the Type to "audio/x-ym" the filetype file should be named as "x-ym" too, for the clarity at least.



    Thank you , those tips helped and I was able to create my filetype.
  • »21.10.26 - 11:59
    Profile