Can an App check how it was started?

Started by Carlo Didier, September 10, 2019, 11:35:09 AM

Previous topic - Next topic

Carlo Didier

Example: An app is configured to appear in the context menus of "fileWindow" and "fileWindowMediaFolders". In the first case, it should do something with the selected files, in the second case with all files in the folder, independently of the current selection.
For this to work, it has to check from which point it was started. A workaround would be two versions of the app, one pinned to "fileWindow" and the other to "fileWindowMediaFolders"

Mario

#1
This information is currently not available for apps.
I don't know for how many users who write apps such a distinction would make any difference. Feel free to post a feature request so I can learn if this is something other users want too.

Your app could just query the file window status to learn about the current context (e.g. which type of data the file window is displaying). There is an endpoint for that.

Another quick way to handle this would be several tiny "app launcher" apps. You link each of the launchers to one of your menus and when the launcher app is triggered it launches the real app, providing information about the context via the URL parameter.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Quote from: Mario on September 10, 2019, 12:07:44 PM
This information is currently not available for apps.
I don't know for how many users who write apps such a distinction would make any difference. Feel free to post a feature request so I can learn if this is something other users want too.

Your app could just query the file window status to learn about the current context (e.g. which type of data the file window is displaying). There is an endpoint for that.

Another quick way to handle this would be several tiny "app launcher" apps. You link each of the launchers to one of your menus and when the launcher app is triggered it launches the real app, providing information about the context via the URL parameter.
That last one is a good idea.
Your proposal concerning current context would not work because I need to know if I right-clicked in the "Media & Folder" Panel or in the file window.