08-13-2019, 08:45 AM | #1 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
"Open with..." with a switch, how to?
I want to proccess a .xhtml file from Sigil with external program but I also want the file will be open (externally) with a command option and the "Open with..." dialog doesn't allow me to do that. How must I procced in those cases?
Thanks in advance. |
08-13-2019, 10:19 AM | #2 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Create an executable batch file or link and add command line option inside of that.
|
Advert | |
|
08-13-2019, 10:55 AM | #3 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
08-13-2019, 12:24 PM | #4 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
I made a bat file with the following command:
MyProgram.exe -u %1 and I saved all as "MyBat.bat". If I drop a .xhtml file on that .bat, all works fine but if I want to proccess a .xhtml file with the same .bat by means of "Open with..." nothing happens. What am I doing wrong? |
08-13-2019, 02:07 PM | #5 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Is MyProgram.exe on your PATH?
I'm able to use the following in a batch file on Windows 10 and pass the /p parameter to EditPadLite (to open in Print Preview) and have it work with Open With. Code:
"C:\Program Files\Just Great Software\EditPad Lite 7\EditPadLite7.exe" /p %1 |
Advert | |
|
08-13-2019, 02:54 PM | #6 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
No it isn't. But the .bat file is in the same folder of MyProgram.exe (with a different name of the .exe file).
But now I'm suspecting it can be a bug. I made a .bat file with the following line: c:\windows\notepad.exe %1 The path wouldn't be neccesary because notepad.exe is in the Windows folder, but even so, I wrote the path to notepad in the .bat. Well, after selecting with "Open with..." that .bat file, the .xhtml didn't open inside Notepad (nothing happened). But, if instead of using the .bat, I open the .xhtml file directly with Notepad (throught Open with), the file is open without issue. |
08-13-2019, 03:04 PM | #7 | ||
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Quote:
c:\windows\notepad.exe %1 in a batch file works to open xhtml files from Book Browser in notepad on my Windows machine. Last edited by DiapDealer; 08-13-2019 at 03:15 PM. |
||
08-13-2019, 03:59 PM | #8 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
How weird! Maybe is something with my Windows 7. I tried with others text editor (Notepad++, Sublime) and I can't open the .xhtml by means of a .bat with "Open with...". But if I drop a .xhtml file on the .bat file, the .xhtml is loaded perfectly (so, the .bat is ok).
|
08-13-2019, 04:03 PM | #9 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'll test on Windows 7 when I get home to make sure it's not some sort of 10 vs 7 thing.
But rather then testing by dropping files on the batch file, try running it from a terminal and providing the path to the xhtml file as a parameter. That will more closely approximate how Sigil will be launching things. |
08-13-2019, 04:48 PM | #10 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Hmmm. I get the same results you do on Windows 7. I'll have to do some investigating.
|
08-13-2019, 04:56 PM | #11 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
The .bat works perfectly from a terminal. So, the .bat file is ok.
|
08-13-2019, 04:59 PM | #12 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
08-13-2019, 05:16 PM | #13 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
perhaps it needs something else to launch it. It was a long way back but I remember a command called "start" that was needed to launch certain filetypes but ...
|
08-13-2019, 06:15 PM | #14 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
I tried with "start" and doen't work either But the weird thing is that on Windows 10 Diap says that all work perfectly (without the command "start").
|
08-13-2019, 07:00 PM | #15 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hmm the only other things I remember was usung the first line to set the drive
so something like: c: c:\windows\notepad.exe %1 and then renaming it from .bat to .cmd but that is the limit of my knowledge. DiapDealer is really the expert here. Perhaps he can figure out what is different between Windows 7 and Windows 10 here. Sorry. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Troubleshooting Kindle Dx Graphite with corrupted software, does not switch to "registered" | wincel | Amazon Kindle | 26 | 10-03-2020 11:05 AM |
Alter Double-click behaviour to "edit metadata" instead of "open ebook?" | Feather_Qwill | Library Management | 5 | 09-15-2013 11:20 AM |
How to remove "Fully read" books from "Last Open" list? | pjeanetta | PocketBook | 4 | 12-08-2010 10:30 AM |
"Liquid" / "Fixed" - how to switch layouts | Alexander Turcic | Announcements | 0 | 06-05-2007 09:29 AM |
Sony Connect "Bait and Switch" Advertising? | TheMooch | Sony Reader | 5 | 02-21-2007 01:43 AM |