Ambient Mime types
  • Caterpillar
    Caterpillar
    Posts: 30 from 2016/12/29
    Oh I'm sorry... either I'm stupid or I just missed something very fundamental, but I'm having a hard time trying to figure out how to configure new Ambient Mime types. Even online I couldn't find anything useful (or I just missed it ?)
    To me, it looks there's not an easy way to configure new Mime types. The ones pre configured seem fixed, and I couldn't find any way to add new ones. For example, let's assume I want to add a mime type for text files with (example) an .xyz
    suffix or with other internal attributes (first bytes matching some special values)... there's apparently no way to achieve
    that, unless editing by hand Mossys:Ambient/recognition.db (despite it remarks loudly "!!! DO NOT EDIT THIS FILE !!!")
    It seems that with Ambient the most u can do is just change the default actions for preconfigured Mime types.
    AmigaOS DefIcons instead let the user create new file types and edit pre-configured ones quite easily and intuitively.
    Is it possible that the same can't be done with Ambient ??
    Any input is appreciated, thanks..
  • »26.01.17 - 14:15
    Profile
  • MorphOS Developer
    geit
    Posts: 880 from 2004/9/23
    Quote:

    Barren wrote:
    there's apparently no way to achieve
    that, unless editing by hand Mossys:Ambient/recognition.db (despite it remarks loudly "!!! DO NOT EDIT THIS FILE !!!")
    It seems that with Ambient the most u can do is just change the default actions for preconfigured Mime types.
    AmigaOS DefIcons instead let the user create new file types and edit pre-configured ones quite easily and intuitively.
    Is it possible that the same can't be done with Ambient ??
    Any input is appreciated, thanks..




    You already found the instructions, you just stopped reading on the "!!! DO NOT EDIT THIS FILE !!!" line, where the instructions how to apply own filetypes is following.

    The only reason for no to edit the file is that you will loose your stuff at any further update or system repair. Even if you backup and restore data, you will loose any updates made to the database by the ambient team.

    Therefore like for mostly anything an alternate path exists, where you can store additional or replacement data. In this case once you change a file action it will stored at SYS:prefs/ambient/filetypes/#? for the same reason. Even Ambient cannot store changed config data inside that file for the same reason.
  • »26.01.17 - 14:36
    Profile
  • Caterpillar
    Caterpillar
    Posts: 30 from 2016/12/29
    mmm... yeah ok sorry but I've still a hard time figuring out the logic... I hope time will help...

    For example, it looks like there are some internally defined types, this doesn't make much sense. For example,
    the type "MorphOS executable" is recognized by Ambient but not listed in recognition.db. Same thing possibly
    for Amiga os 68K executables. I wanted to make default icons to differentiate between elf and 68k executables as I
    was used to under AmigaOS but I don't see an easy way to achieve that.

    Another issue... how can I set a MIME type for dos scripts ? I can't see a way to configure a filetype basing on
    its S flag. I wanted to specify some default options for it, like Edit, View, Execute, other than specify a default
    icon for scripts.

    Meh... I hope it's just me who can't see the logic behind all that yet...
  • »28.01.17 - 22:45
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    NewSense
    Posts: 503 from 2012/11/10
    From: Manchester, Gr...
    I don't know which text editor you seem to be importing the text of your remarks from, but the wordwrap that is built-in to these pages is being bypassed, and your text is not being imported correctly due to the embedded codes in the imported text, it seems, and I do not really understand why you are not writing the text on these webpages in the reply/comment editor provided so this does not happen.

    You seem to be finding difficulty with many things that you used to do on an Amiga, and yet now want to do on MorphOS - the same way you did on a Classic Amiga.

    MorphOS is different than a Classic Amiga - you have to learn that straight off, and that, for me and many others, is usually a good thing. Of course, there are some methods that MorphOS uses that are different to the way a Classic Amiga or even a NG Amiga does things for that matter, that you will need to learn, and understand. So some ways you used to achieve them on a Classic Amiga just don't work that way on MorphOS, &/or sometimes it may be that you cannot get them to work in any way you may try on MorphOS - there are limitations with every operating system. There are many things on MorphOS that are better than either NGAmiga or Classic Amiga as well. 8-D

    I am not trying to be harsh on you, it is just the way MorphOS works that's all. You, like the rest of us, just have to learn to use it to suit you.

    MIME is not very well explained in the MorphOS Library, but there are quite a few MUI Help 'Bubbles' to guide you along for the most part, and I have adjusted my system in some ways to suit my needs/programs I use more frequently than the default ones that are already setup after installation, especially if you install the Chrysalis Pack as well.

    If you want to view an image, then the default is Multiview, but there are also other similar programs that are already setup as options to view an image with, via the right mouse-click, like ShowGirls, and LoView that have been setup with their own MIME types, and so examining the way they work can give you an insight as to what is possible, and may in the end suit your needs, and what you are trying to achieve. :-D
    Mac Mini 1.5GHz, Model 10.2, 64MB VRam, 250GB HDD, 1GB RAM, Airport, Bluetooth, Wireless Keyboard & Mouse, DVD-RW-DL+CD-RW, Iomega MiniMax, Belkin 6 port 3 x Firewire/3 x USB2, MorphOS 3.9, Mac OS X 10.4 & 10.5 & A1138 Powerbook MOS v3.9, Model 5,8
  • »30.01.17 - 03:03
    Profile
  • Caterpillar
    Caterpillar
    Posts: 30 from 2016/12/29
    Not sure what u are talking of... I'm not useing any text editor. Perhaps I have just the bad habit to instinctively press return when I reach the end of the line. Ohhhh soooo soorrry I will try to avoid that.
    But I think that, rather than being harsh at me (I'm citing you lol) you should have addressed my point: how can I setup a mime type for dos scripts properly, and how can I set up mime types for MOS elf executables and amiga os 68K ones, even just to associate different icons. I bet it's impossible. Do u want to bet ? I'm ready LOL ;)
    To me (and honestly I'm not stupid, sorry) it looks like there are many incongruencies or illogical things behind Ambient mime types. Not that I'm happy to say that OF COURSE. Oh, and I'm not advocating Amiga etc. I'm just saying that the way Amiga DefIcons handled mime types (ok call them file types or just default icons) was very good, logic and intuitive. To me. But I'm ready to move a step back the day I realize I'm wrong ^_^
  • »30.01.17 - 22:34
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    takemehomegrandma
    Posts: 2358 from 2003/2/24
    Quote:

    Barren wrote:
    how can I set up mime types for MOS elf executables and amiga os 68K ones, even just to associate different icons.


    Regrettably I don't have an answer for you (maybe someone else does?), but I'm a bit curious to why you want to make a difference between them in that way?

    Making a seamless experience is kind of an essential feature of current MorohOS, the Amiga 3.1 API is there and the applications are all being run as PPC executables side by side at execution time, no matter the origin.
    MorphOS is Amiga done right! :-)
    MorphOS NG will be AROS done right! :-)
  • »30.01.17 - 23:33
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    NewSense
    Posts: 503 from 2012/11/10
    From: Manchester, Gr...
    Quote:

    Barren wrote: Perhaps I have just the bad habit to instinctively press return when I reach the end of the line. Ohhhh soooo soorrry I will try to avoid that.

    I am not 'having a go' at you, I would just have thought you already knew that word-wrap is enabled when you type into the input editor. However, as you'd more recently come from an Amiga background, as many of us have, then you might have written the text on your Amiga and transferred it here, and it had imported the incorrect word-wrap that often is associated with some of the Classic Amiga editors. That's obviously not the case so it's more a heads-up in this case. :-)

    Quote:

    Barren wrote: how can I setup a mime type for dos scripts properly, and how can I set up mime types for MOS elf executables and amiga os 68K ones, even just to associate different icons. I bet it's impossible.

    I am not sure what you are trying to achieve with a DOS script, but you may want to take a look at the MorphOS Library for more inspiration or wait a little longer for any of the developers to come along with more guidance.

    I should say that if you have a MOS executable then the system should recognise that automatically, and the same for 68k executables, but obviously some 68k executables, such as games that 'hit the hardware' may only run within an Amiga Emulator, though many applications run through 'Trance' without issues.

    You could also have a read through the MorphOS Library, in particular:

    Getting Started - then scroll or search to the part on - Open PDF Files Automatically, and take a look at the associated screenshot, just below, which may give you an idea of what you want to do.

    Though it's probably as easy to select from the right-click menu Settings > Ambient > MIME and then choose 'text' or 'internal' and click the [+] to expand each of those options list to see other files and how they work, and see if there is a suggestion there to prompt you to work out what you are trying to achieve. :-o
    Mac Mini 1.5GHz, Model 10.2, 64MB VRam, 250GB HDD, 1GB RAM, Airport, Bluetooth, Wireless Keyboard & Mouse, DVD-RW-DL+CD-RW, Iomega MiniMax, Belkin 6 port 3 x Firewire/3 x USB2, MorphOS 3.9, Mac OS X 10.4 & 10.5 & A1138 Powerbook MOS v3.9, Model 5,8
  • »31.01.17 - 02:11
    Profile
  • jPV
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jPV
    Posts: 1270 from 2003/2/24
    From: po-RNO
    Here's how I see the situation. Ambient's mime/filetypes system is highly inspired by filetype system in DOpus. On Amiga DOpus' filetypes were the best thing since the sliced bread and no other alternatives came even close. DOpus filetypes were much more advanced and versatile than, for example, the Deficons. If you know how to configure DOpus filetypes, you know how to configure Ambient's mimetypes from the settings GUI too. The upper (user) level configuration for actions for doubleclicking, context menus, and drag&drop is very similar on both and shouldn't cause any confusion, and is still the best thing since the sliced bread ;)

    The difference is how the internal recognizing of files is done. On DOpus you need a separate file in the Filetypes drawer for each type of file. There are some filetypes provided by default, but they aren't that comprehensive, and user has to create lots of own definitions when building the system. Ambient, OTOH, tries to provide recognition for as many file types as possible by default, the built-in recognition database is a single file (MOSSYS:Ambient/recognition.db) and tries to cover practically all known/standardized file types, and in most cases that is enough for normal users. If user wants to create custom filetypes not found in the database, he can do that by creating definitions to SYS:Prefs/Ambient/filetypes/ drawer. A text editor is needed for this with Ambient, compared to GUI in DOpus, but basically the format is similar on both and should look familiar. But the main point is that users usually shouldn't need to care about the recognizing settings at all with Ambient. Here is one example how to create a custom entry anyway.

    Now to the Barren's problem... there seems to be few filetype exceptions which aren't included in the recognition.db file and aren't shown in the Ambient Mime settings. These internal types just aren't probably meant to be editable by a user, maybe because if user cripples them, the whole system becomes crippled? AmigaOS 68k executables, MorphOS executables, and AmigaDOS script files seem to be such, and it sounds dangerous if user messes their execution or so. Of course it would be nice that you could edit certain options for them, but maybe it would have just added mess to Ambient settings GUI if some types should be handled in a different way from all others.

    But maybe there are ways to change them anyway if you insist. Maybe they still can be overridden by manual definition to that filetypes drawer. Make your own definition with bigger priority, or try to find out names and just add actions to them without changing the recognition, or something like that. And just to change the default icons, maybe Ambient would load different default icons for them if you'd have correctly named icons in SYS:Prefs/Presets/Deficons/ drawers, I'd be surprised if it wouldn't work, but if it really doesn't work, I'd say there's a room for a feature request :)


    Quote:

    Another issue... how can I set a MIME type for dos scripts ? I can't see a way to configure a filetype basing on
    its S flag. I wanted to specify some default options for it, like Edit, View, Execute


    If we can't find a way to edit Script options via custom filetypes, you can always have certain options for all files. I have Edit (CEd) option for "Global Actions for Files" mime type, and that gives me possibility to edit any files (including scripts) whenever I want. Maybe not as pretty, but works. And you never know what format files you need to edit, so it's there always. I sometimes even edit binary files with it ;) Similarly you could add options to execute, view etc there, or maybe make a submenu for these kind of functions which may not be usable for all files, but are there just in case.

    But anyway interesting topic and you have a point in these few exceptions... let's see what we can find out. I'll try to investigate more too :)


    [ Edited by jPV 31.01.2017 - 10:40 ]
  • »31.01.17 - 09:06
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 8978 from 2003/5/22
    From: Germany
    > Getting Started [...] Open PDF Files Automatically

    That is about OWB MIME types, not Ambient MIME types.
  • »31.01.17 - 11:53
    Profile
  • Caterpillar
    Caterpillar
    Posts: 30 from 2016/12/29
    Thank u jPV, u seem the only one who got my point LOL
    I'm sorry unfortunately I can't spend much time currently with these things or to reply everybody properly (my fault, very sorry)...

    Fact is, to discover what u just wrote above, i.e that to set custom default icons for executables (and scripts too) I had to name them application/x-amigados for script, application/x-executable etc. , I had to... wonder what ? Go looking into Ambient source code !!! This is not much logical IMHO... there should not be too many "internal" things here or things an user should "assume", I mean. IMHO, the only "internal" types should be very root ones, i,.e perhaps only File and Directory and so on. But I'm not going to preeeeach here about what Ambient should and should not do LOL, otherwise somebody could easily tell me "then write ur own desktop if u can, or put your hands in Ambient code and fork it to suit your own tastes" - and I can't blame him ;) Said very friendly ;)

    Anyway, as you correctly pointed out, yeah that is something I just discovered too. I can't override the SCRIPT type !
    I tried all the ways. I pretty came to your same idea too and before reading the replies here (so I'm not stupid, yay yay !!!), i.e adding a file x-amigados:

    AMTD
    1
    Type application/x-amigados
    Name Script
    Priority 128
    Action
    Name Execute
    Event Menu
    Command AMIGADOS Execute %sp
    End
    End

    to sys:prefs/Ambient/filetypes/application/ Without luck. I even tried to put Priority 999, no hopes.

    Yeah I noticed too there's an internal option to detect protection bits but it's not parsed as an external command unfortunately...

    The strange thing is, when u define the custom type above in the hope to override the internal one, it actually GETS listed in Ambient MIME prefs gui and can even be edited, but this type is NOT used at file detection level. In fact, if u (for example) specify above "Name script2" instead of "Name script", u can easily check that (even after a reboot) when u open the context menu over a script type, u keep reading "script" in the menu title and not "script2" or whatever name u specify else - a clear symptom that ur new type is recorded but NOT used.

    Oh I also noticed that more strange things happen at such proposal... for example, if I have a text file in RAM: and I set its S bit with the Info requester, the file gets still detected as text, not script. The same happens if I close and reopen the ram: window. BUT, if I move that file to somewhere else, voilĂ  it now gets finally detected as script. Some cache issues, it seems...

    To cover other questions... no I don't care tampereing with what MOS/Ambient does with Elf or 68K executables (even if I think the user should be given full responsibility of what he/she does, in theory... this is my policy at least LOL). I just wanted to change their fucking (sorry ;) ) default icons, just to distinguish in a mess of files what is what. Call it eyecandy LOL. And luckily I could do it once I discovered by looking into Ambient sources how such types were called.
    I can read these replies only now, sorry... So at least now I'm happy with my icons finally LOL LOL LOL ;)

    But I think I must also justify my need to change/tailor the Script filetype to my needs... under AmigaOS I was used to associate a script to script files. Such script simply opened a requester asking "what to do with this script ? Edit - View - Execute" and so on. Something I would like to replicate under Ambient in a nicer way of course. Like... configuring menu entries for script types, adding Edit, View, or Execute... maybe letting Execute the default (double click) defined action.

    As you jPV correctly implied, more or less, the ONLY way to achieve that is, indeed, to set those actions for the root (i.e for every files) which is not so "nice" if we want. And we agree here.
    Another option I thought of is: ignoring the fact dos scripts have the +S flag set; define a custom MIME type of TEXT class, call all your scripts with a .bat suffix (for example), and specify the above said actions for those.
    Still not very nice or clean... and I will be limited only to some scripts named that way, i.e I can't do the same with (for example) startup-sequences or other scripts I can't and don't want to add the .bat suffix to...

    Anyway, I find it strange that the Script type can't be overridden, not even by increasing the priority to 999 ! Maybe 666 will work ? LOL I'm kidding ^_^
    And I have definitely no time to study Ambient sources more in depth, not to speak of changing them and recompiling LOL

    Also I find it very strange or not so "clean" the fact (look at mimeuri.h) some types like VORBIS and MPEGA has to be defined as internals ?!? Clearly there's still some work to do with Ambient MIME types to smooth all corners out, how to say it...

    Oh again I apologize in advance if I pressed RETURN again at some EOLs. I tried not to. Just u can't get rid of some bad habits so easily and I don't definitely want to go seeing a brainshrink for that LOL

    Thank u for paying me attention though, at least my migration from my previous hybrid AmigaOS/MOS 1.4.5 system is 99% completed and I'm happily useing MOS 3.9 I paid money for, and already doing 99% things with it.
    I'm always listening and putting into practice all your suggestions, said in general, even if more than often it takes some time and I can't comment on every one...
    .Bar
  • »01.02.17 - 15:35
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    NewSense
    Posts: 503 from 2012/11/10
    From: Manchester, Gr...
    This topic isn't so old, and seeing as Barren brought up this interesting topic, I thought I'd ask . . . .

    I'd also like to be able to add a .WMF and .CGM filetypes into MorphOS, as I often need to convert vectored clipart in WMF and CGM format into files that I can use on MorphOS directly, such as, ILBM/IFF, BMP, etc which I like to convert using Metaview v2.9, which is usually quite stable under MorphOS 68k emulation.

    I have managed to add the .DR2D filetype into MorphOS MIME prefs as it is recognised as .X-IFF filetype, which is already part of MorphOS Ambient MIME types, and can be set quite simply to open directly with a right-click on the file - choosing open with - Metaview.

    Can someone give clear instructions on how to create a new filetype, if this is possible, so I can adapt MorphOS to suit my needs. 8-)
    Mac Mini 1.5GHz, Model 10.2, 64MB VRam, 250GB HDD, 1GB RAM, Airport, Bluetooth, Wireless Keyboard & Mouse, DVD-RW-DL+CD-RW, Iomega MiniMax, Belkin 6 port 3 x Firewire/3 x USB2, MorphOS 3.9, Mac OS X 10.4 & 10.5 & A1138 Powerbook MOS v3.9, Model 5,8
  • »28.02.17 - 02:16
    Profile
  • jPV
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jPV
    Posts: 1270 from 2003/2/24
    From: po-RNO
    Quote:

    NewSense wrote:
    Can someone give clear instructions on how to create a new filetype, if this is possible, so I can adapt MorphOS to suit my needs. 8-)


    Here is how I'd do it:

    1) First open the http://www.iana.org/assignments/media-types/ page (as suggested in the SYS:MorphOS/Ambient/recognition.db file), and look for the wanted media type.

    2) We can find wmf there, and it seems to be categorized as image/wmf, let's click the "image/wmf" link in the second column on the page to get more information. We see its full name "Windows Metafile Format", extension .wmf (naturally), and magic numbers (D7 CD C6 9A), which is extremely useful info. Now we know all we need to know and can create a new filetype.

    3) Ambient's filetype directory has the same hierarchy with the standard media type categories, so we can place our wmf filetype into the image directory. Let's create a new file there, for example from the shell: Ed SYS:Prefs/Ambient/filetypes/image/wmf

    4) Type in the standard headers which all filetypes should contain:
    Code:
    AMTD
    1

    Then the type line (we got the type in step 2):
    Code:
    Type image/wmf

    And the name we also got in step 2:
    Code:
    Name Windows Metafile Format

    Then start the match block, which defines how the file is recognized:
    Code:
    Match

    Let's add the pattern hint rule with the extension we know:
    Code:
    PatternHint #?.wmf

    And then the actual matching rule. We got the magic numbers in the step 2 and they indicate the hex numbers found from the beginning of each wmf file. We tell Ambient to look for those numbers to make the recognition. $ tells the searching will be done in hex format.
    Code:
    Match $D7CDC69A

    Now we can end the match block:
    Code:
    End

    We also need another End to end the whole filetype definition:
    Code:
    End


    You can also make the inner blocks intented to make it look cleaner, here's the whole filetype definition:
    Code:
    AMTD
    1
    Type image/wmf
    Name Windows Metafile Format
    Match
    PatternHint #?.wmf
    Match $D7CDC69A
    End
    End


    5) Save the file and we're done. You can now open the Ambient MIME type settings and add new actions for the new filetype there.


    Let's try the same for CGM then. The page in the step 1 tells us that its name is "Computer Graphics Metafile" and it's type is "image/cgm". Unfortunately it doesn't seem to tell more about the recognition, and a quick googling reveals that files may contain the string "BegMF", but not always.

    We have to create a rule which will work even if that string isn't found, I think we have to fallback to filename based recognitioning in this case. So, let's create a rule which first tries to match the string (add "s" in front of it to indicate it's a plain text string instead of hex or so) or if it's not found then to filename:
    Code:
    Match sBegMF
    OR
    Name #?.cgm

    You could also match only to name, but it's more elegant to match the contents when you can.

    Full filetype for the cgm would be like this then:
    Code:
    AMTD
    1
    Type image/cgm
    Name Computer Graphics Metafile
    Match
    PatternHint #?.cgm
    Match sBegMF
    OR
    Name #?.cgm
    End
    End
  • »28.02.17 - 08:03
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    NewSense
    Posts: 503 from 2012/11/10
    From: Manchester, Gr...
    Thanks jPV for those instructions - THEY WORK, well at least for me, that is. . . . once I had rebooted the system, as the filetypes seem to be read-in at boot-up, and not if they are changed after that. Anyway, once I had adjusted the Ambient MIME types 'action' with Metaview as my chosen program to open the filetype then both the WMF and CGM files opened Metaview when double-clicked on, so I am very grateful to you for your little workshop in adjusting/editing/defining MIME/Filetypes in MorphOS.8-D

    Maybe you should add that 'lesson' into the library you are building 'all by yourself' on such features for MorphOS. 8-)

    I have not forgotten about RNO info issues we discussed and I will let you have more feedback on that shortly.;-)
    Mac Mini 1.5GHz, Model 10.2, 64MB VRam, 250GB HDD, 1GB RAM, Airport, Bluetooth, Wireless Keyboard & Mouse, DVD-RW-DL+CD-RW, Iomega MiniMax, Belkin 6 port 3 x Firewire/3 x USB2, MorphOS 3.9, Mac OS X 10.4 & 10.5 & A1138 Powerbook MOS v3.9, Model 5,8
  • »28.02.17 - 21:11
    Profile
  • Just looking around
    Posts: 20 from 2017/3/16
    When I click on a pdf file the mime type for it automatically ensures that it opens via vpdf, because the mime type command reads vpdf %sp.

    I am trying to do something similar for ghostscript, but have so far failed. The longwinded way which does work perfectly is as follows:

    Place the relevant file, called file.ps say, into ram. Launch ghostscript via sys:applications/ghostscript/bin/gs. This brings up the gs window into which I next type (ram:file.ps) run Everything works fine then.

    My question is how to implement that through a ps mime type? What commands do I need to enter? The problem seems to be the brackets surrounding the filename and the extra run command. Does anyone know the solution or correct syntax?

    RD
    ---------

    Quote:

    NewSense wrote:
    Quote:

    Barren wrote: Perhaps I have just the bad habit to instinctively press return when I reach the end of the line. Ohhhh soooo soorrry I will try to avoid that.

    I am not 'having a go' at you, I would just have thought you already knew that word-wrap is enabled when you type into the input editor. However, as you'd more recently come from an Amiga background, as many of us have, then you might have written the text on your Amiga and transferred it here, and it had imported the incorrect word-wrap that often is associated with some of the Classic Amiga editors. That's obviously not the case so it's more a heads-up in this case. :-)

    Quote:

    Barren wrote: how can I setup a mime type for dos scripts properly, and how can I set up mime types for MOS elf executables and amiga os 68K ones, even just to associate different icons. I bet it's impossible.

    I am not sure what you are trying to achieve with a DOS script, but you may want to take a look at the MorphOS Library for more inspiration or wait a little longer for any of the developers to come along with more guidance.

    I should say that if you have a MOS executable then the system should recognise that automatically, and the same for 68k executables, but obviously some 68k executables, such as games that 'hit the hardware' may only run within an Amiga Emulator, though many applications run through 'Trance' without issues.

    You could also have a read through the MorphOS Library, in particular:

    Getting Started - then scroll or search to the part on - Open PDF Files Automatically, and take a look at the associated screenshot, just below, which may give you an idea of what you want to do.

    Though it's probably as easy to select from the right-click menu Settings > Ambient > MIME and then choose 'text' or 'internal' and click the [+] to expand each of those options list to see other files and how they work, and see if there is a suggestion there to prompt you to work out what you are trying to achieve. :-o
  • »26.05.17 - 01:39
    Profile
  • jPV
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jPV
    Posts: 1270 from 2003/2/24
    From: po-RNO
    Quote:

    Robdel wrote:
    When I click on a pdf file the mime type for it automatically ensures that it opens via vpdf, because the mime type command reads vpdf %sp.

    I am trying to do something similar for ghostscript, but have so far failed. The longwinded way which does work perfectly is as follows:

    Place the relevant file, called file.ps say, into ram. Launch ghostscript via sys:applications/ghostscript/bin/gs. This brings up the gs window into which I next type (ram:file.ps) run Everything works fine then.

    My question is how to implement that through a ps mime type? What commands do I need to enter? The problem seems to be the brackets surrounding the filename and the extra run command. Does anyone know the solution or correct syntax?



    If you try to launch "gs:bin/gs -h" in the shell (or with -help or --help argument), you get a description of the command line arguments. It appears that you don't need to use brackets when giving a file as an argument, so simple "gs:bin/gs ram:file.ps" will work.

    Also if you want that program quits automatically after viewing a file and want to disable the text output to see just the graphical output, I'd use this kind of line in the mime settings for the already existing postscript mimetype:
    Run >NIL: gs:bin/gs -dBATCH -dNOPAUSE %sp


    [ Edited by jPV 26.05.2017 - 16:27 ]
  • »26.05.17 - 14:23
    Profile Visit Website
  • Just looking around
    Posts: 20 from 2017/3/16
    Thank you very much for your suggestion. It works well. This is a good example of why forums are useful.



    quote]jPV wrote:
    Quote:

    Robdel wrote:
    When I click on a pdf file the mime type for it automatically ensures that it opens via vpdf, because the mime type command reads vpdf %sp.

    I am trying to do something similar for ghostscript, but have so far failed. The longwinded way which does work perfectly is as follows:

    Place the relevant file, called file.ps say, into ram. Launch ghostscript via sys:applications/ghostscript/bin/gs. This brings up the gs window into which I next type (ram:file.ps) run Everything works fine then.

    My question is how to implement that through a ps mime type? What commands do I need to enter? The problem seems to be the brackets surrounding the filename and the extra run command. Does anyone know the solution or correct syntax?



    If you try to launch "gs:bin/gs -h" in the shell (or with -help or --help argument), you get a description of the command line arguments. It appears that you don't need to use brackets when giving a file as an argument, so simple "gs:bin/gs ram:file.ps" will work.

    Also if you want that program quits automatically after viewing a file and want to disable the text output to see just the graphical output, I'd use this kind of line in the mime settings for the already existing postscript mimetype:
    Run >NIL: gs:bin/gs -dBATCH -dNOPAUSE %sp

  • »27.05.17 - 07:12
    Profile

  •