Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Coding Doble-click to open a data file

  • Doble-click to open a data file

    Posted by Giacomo Manzoli on December 2, 2019 at 9:50 am

    Hi all,
    is it possible to implement a “doble click open file” behavior for an Omnis data file?
    I know that on macOS is possible to associate a particular file type to an application (via the Info.plist), so when the user double clicks a file, the OS opens the associated applications.
    Omnis does this with the library file. If i double click a library file, the OS lanches Omnis Studio and then Omnis Studio opens the library i double clicked.
    I’ve managed to correctly associate a custom file type to a datafile created by my Omnis Runtime and then to associate the type to Omnis. So, when the user double clicks a datafile, the OS launches my customized version of Omnis. The problem is that, after the startup is completed, i have no information about the file that the user wanted to open. Does anyone if it is possible to recive some event with the file infos (the filepath is enough)

    Christoph Schwerdtner replied 2 months, 4 weeks ago 2 Members · 1 Reply
  • 1 Reply
  • Christoph Schwerdtner

    Member
    May 19, 2022 at 4:45 am

    Hi Giacomo,
    No answer to this question yet so I can give you my idea:
    In Windows registry you can modify the associated executable and also give parameters to the command. The file can be a parameter too.
    You could create a batch file that gets the parameter, write it to a temp file with a timestamp as second info. Then start Omnis with your lib, that would check the config file, get the df path if the timestamp is within last 10 secs and you can do anything you want if timestamp matches. This way a manual start without batch would not accidentally open an older start of that df1.

    Hope it helps
    Christoph

Log in to reply.