husonlab / dendroscope3

Dendroscope program for analyzing and visualizing rooted phylogenetic trees and networks
GNU General Public License v3.0
41 stars 5 forks source link

file associations automatically opening files #4

Open davidmatten opened 7 years ago

davidmatten commented 7 years ago

In a windows environment, it is common to double click on a file of a given type and have the associated software open that file. With Dendroscope (to my limited understanding), it appears this is not the behaviour.

If I am wrong, please forgive me - and let me know how to achieve this behaviour.

davidmatten commented 7 years ago

In an attempt to get around this, I have created a batch file to call Dendroscope, with an execute command following: START C:\Dendroscope\Dendroscope.exe -x 'open file=%1' Then told windows to open .nexus files with that batch file (See attached screen shot) dendroscope2

The problem this throws up is it appears Dendroscope doesn't play nice with double quotes surrounding the file name. I was able to open the file, through dendroscopes menu items, and then the text generated in the command window reflects single quotes around the file name. See the attached screen shot for details. dendroscope

davidmatten commented 7 years ago

semi-solution found: use a tilde between the percentage and the number. %~1 This will remove double quotes surrounding the filepath.

davidmatten commented 7 years ago

semi-solution found: use a tilde between the percentage and the number. %~1 This will remove double quotes surrounding the filepath.

davidmatten commented 7 years ago

The above doesn't work with spaces in the file path. To deal with that edit your batch file to be: SET filename=%1 SET filename=%filename:"='% START C:\Dendroscope\Dendroscope.exe -x "open file-%filename%"

You can do this in one line - I have expanded it here so others can follow through with what steps are happening.

So, in summary: There is a way around the issue. Its detailed above. It would be rad if this could be included into Dendroscope.

(: