![]() |
#1 |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2015
Device: PC
|
Use filename without full path in 'open with'
Hi, this question is pretty hard to search, since it could be paraphrased in many different ways.
I am talking about 'Open With' function of Calibre library. If I understand correctly, there are no tags which could be substituted in command line with name, path, etc of opened file. Calibre simply adds full path of book file after all args. What I want is to 1. change working directory to book directory and 2. run this command with filename of book only, without full path to it. That is because I use external reader which saves bookmarks in separate file, but it creates it in 'working' folder, not in opened book folder. Development is stopped so I can't request a fix from it's creator. I guess it would be possible to run cmd /c with required parameters IF there was a %filename% substitution tag but alas I didn't see anything like that in help. Am I stuck? |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Andys
If you ALWAYS want to use that external reader and as long as it is registered as the default for the file type with the OS (you can doubleclick that file type in the explorer and it opens in that reader) Simply remove the Tic next to the type in Preferences: Behavior: Use Internal viewer for The Calibre will use the OS to open that file type when you tap View (V) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Should be as simple as setting the cwd to the parent directory of the ebook file.
I can't specifically think of any reason why that might be a bad idea, so, if you are talking about the plugin, here is a patch and a fixed copy that does just that. |
![]() |
![]() |
![]() |
#4 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Mar 2015
Device: PC
|
Quote:
I got my solution through autoit exe, which acts as a cmd file - splits path and file name, CD's to path and runs my viewer. I compiled it to exe and this works. Code if anyone else will want this function in future, though it's pretty specific to alreader2 and there's almost none other viewers which save bookmarks in external file in same folder (so I can copy both files anywhere and keep bookmarks working) Code:
#include <File.au3> global $drive, $path, $fname, $fext _PathSplit($cmdline[1],$drive,$path,$fname,$fext) FileChangeDir($drive & $path) $cmd = "D:\Office\AlReader\AlReader2.exe """ & $fname & $fext & """" Run("D:\Office\AlReader\AlReader2.exe """ & $fname & $fext & """"); Last edited by Andys; 12-11-2015 at 01:42 PM. |
|
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
It's not a calibre patch, it's a patch to the Open With plugin (from before calibre had its own internal Open With feature).
I added it in case anyone was interested in seeing exactly what I changed. The ZIP is the plugin itself. If it fixes things for you, it could be added to the main version. ![]() If I was going to post a patch for calibre itself, I would have it added upstream so everyone benefits. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just use a launcher script, write it in windows bat or powershell or whatever. Have it process the full pathname however you lke and call whatever program you like.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get full path of the book? | esvorontsov | Development | 1 | 10-01-2015 04:46 AM |
DR1000 DR1000S: How to create file shortcuts using a full path? | godel10 | iRex | 12 | 03-20-2010 12:12 AM |
pdf filename and path on KindleDX | ttf | Calibre | 2 | 12-19-2009 02:31 PM |
Save to Disk now saving file with full path? | Mnementh | Calibre | 3 | 09-14-2009 01:24 AM |
Rebuild Database? & Use Path instead of Filename? | gai-jin | Calibre | 0 | 07-20-2009 02:58 PM |