Good idea. We'll add an "Open Containing Folder" entry to the context menu of the "Browse Files" tool (http://www.xmlmind.com/xmleditor/_distrib/doc/help/browseFilesPane.html).

This menu entry will not be called "Show In Finder", which is too related to the Mac.

On the Mac, if macOS behavior really corresponds to what we have understood from the man page:

-R    Reveal the file(s) in the Finder instead of opening them.

this menu entry will indeed invoke command "open -R".

Thank you for your suggestion.



On 11/26/22 22:08, Leif H Silli wrote:
PROPOSAL:

  Inside the CTRL Click menu of the Browse Files Pane, add a ”Reveal in Finder” command and make that command call the following CLI command:

     open -R “%F”

  “Reveal in Finder” what such commands are typically called in MacOS. And, to help users understand how it works, it might also be a good idea to use the long version of the command:

     open --reveal “%F”

PROBLEM:

  On the Mac, there is very little integreration between XXE and the MacOS Finder (AKA the file browser). For example:

  1. It is not possible to tell the system to open a file in XXE (e.g. by double clicking the file in Finder or similar commands).

There is nothing we can do. This is a Java bug which seems have never been fixed. See "JDK-8043852 [macosx] OpenFilesHandler does not receive fileopen events". https://bugs.openjdk.org/browse/JDK-8043852

Moreover, we do use the Desktop integration API (https://openjdk.org/jeps/272) as a replacement as suggested by Java developers in the bug report and it still does not work on the Mac.






  2. And, opposite, XXE does not have a way to let the user show/select/display a selected or active file in Finder.

  I know no solution to the first problem - from Finder to XXE. But, the “open -R” command seems to be a rather simple solution to the second problem - displaying a file in the Finder.


SOLUTION:

  The solution is a MacOS solution only. However, it ought to be pretty low hanging fruit, as it makes use of the CLI open command (a command that we discussed earlier this month):

   In MacOS Terminal.app, if we run

     open --help

   we learn that about the “reveal” option:

       -R, --reveal          Selects in the Finder instead of opening.

  Currently, the 'Default viewer’ command is - by default (sic!) - the following command:

     open "%U"

   But if we add the --reveal option, like so:

     open --reveal "%U” /* Or: open --reveal “%F” */

  Then, selecting the Preview commmand (of XXE’s XHTML menu - for instance) will display the currently active file in the Finder instead of sending the file to the default preview program (for XHTML files, typically to the default Web browser).

  The above hack, by way of modifying the command of the Preview menu, is already possible. However, to make use of the Preview menu option for this, *is* a hack. Also, it requires that one opens the file in XXE, before one can run the command. A better solution, would be to add a submenu called ‘Reveal in Finder’ to the local CTRL Click menu of the 'Browse Files Pane'. Then one can display any file in the Finder, including files that XXE itself is unable to display.



--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to