Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-12-2016, 10:19 PM   #1
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Macros for tag additions?

If this capability already exists, a pointer is welcome. It won't be the first time I've missed something under my nose.

When importing volumes to Calibre, they often have tags already defined. But sometimes they don't, and the user must create them. (Or add tags they prefer to those predefined.) One capability I'd find useful is short macros that expand to longer lists.

For instance, I have an assortment of SF stories that were originally published in Galaxy Magazine in the 1950's. The copyrights expired, and the stories have been appearing on Project Gutenberg. The standard tag set I apply to these is "Fiction, General, Science Fiction, Short Fiction, Galaxy Magazine". I'm getting enough that a short way of entering that tag set would be a boon.

My thought was a macro, specified with a leading character like @. So @GalMag entered in the Tags field might expand to the tag set above when Calibre processes the entry. There would need to be a macro editor to allow creation, listing, modification, and deletion of tag sets.

Does this seem doable and worth doing?
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-12-2016, 11:06 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
While there is no macro functionality, you can achieve it indirectly ina couple of ways

1) You can create an empty book record witht he standard metadata you want, then use the merge book records function in calibre to copy it from the standard record to the new one

2) You can use a keyboard manager like autohotkey to define macros outside for use in calibre.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-13-2016, 11:06 AM   #3
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by kovidgoyal View Post
While there is no macro functionality, you can achieve it indirectly ina couple of ways

1) You can create an empty book record witht he standard metadata you want, then use the merge book records function in calibre to copy it from the standard record to the new one
I'll look into that.

Quote:
2) You can use a keyboard manager like autohotkey to define macros outside for use in calibre.
I have AutoHotKey here, and that sounds doable.

Ultimately, I'm looking at saving time in entering standard tag sets, so simplest solution wins.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-13-2016, 12:15 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DMcCunney View Post
I'll look into that.


I have AutoHotKey here, and that sounds doable.

Ultimately, I'm looking at saving time in entering standard tag sets, so simplest solution wins.
______
Dennis
Use a (commandline) Batch files for each tag set?
Code:
calibredb set_metadata [options] id [/path/to/metadata.opf
Code:
calibredb add [options] file1 file2 file3 ...
The ID is usually shown in the details (shift-Alt-D) or Information (I) pane
theducks is offline   Reply With Quote
Old 02-13-2016, 06:28 PM   #5
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
One cheap and easy way to do this would be to have a "dummy" text file in Calibre. In the body of the text put your tag sets. Now it's just a matter of copy and paste.
fidvo is offline   Reply With Quote
Advert
Old 02-13-2016, 07:43 PM   #6
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by fidvo View Post
One cheap and easy way to do this would be to have a "dummy" text file in Calibre. In the body of the text put your tag sets. Now it's just a matter of copy and paste.
Good point, but I wouldn't have the file in Calibre. Under Windows, I use a fork of Florian Balmer's Notepad2 as my standard text editor. Notepad2 can be set via a registry hack to replace built-in Notepad, and I do so. It's built on Neil Hodgson's Scintilla edit control, which adds syntax highlighting for various language, code folding, and an assortment of other things out of the box. It invokes instantly here, so I'd just use it to load the tag definitions file, select the line I want, and copy/paste into Calibre.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-14-2016, 12:26 AM   #7
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
Quote:
Originally Posted by DMcCunney View Post
Good point, but I wouldn't have the file in Calibre. Under Windows, I use a fork of Florian Balmer's Notepad2 as my standard text editor. Notepad2 can be set via a registry hack to replace built-in Notepad, and I do so. It's built on Neil Hodgson's Scintilla edit control, which adds syntax highlighting for various language, code folding, and an assortment of other things out of the box. It invokes instantly here, so I'd just use it to load the tag definitions file, select the line I want, and copy/paste into Calibre.
______
Dennis
You can have the best of both worlds if you set Calibre to not open text files natively. When you double-click the dummy file in Calibre, it would send it out to Windows to handle, which in your case would open it in Notepad2.

A number of people have recommended having such a dummy file in Calibre for several purposes, including a placeholder for tags that aren't being used by any other books yet. I use one to store odd formats for configuring the Open With plugin. Funnily enough, most of these ideas don't really have any use for the actual contents of the file, which is what gave me the idea of using it for copy/paste snippets.

By the way, I prefer Notepad++.
fidvo is offline   Reply With Quote
Old 02-14-2016, 04:38 AM   #8
Krazykiwi
Zealot
Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 2156958
Join Date: Jan 2013
Device: Too many random androids to list
You could probably do it quickly with the tag mapper. I use it as a sort of text-expansion macro quite often.

Something like tag them all "galmag" as you add them (you can do that automatically, just change the "tags to add on newly imported books" while you're working), and then have the tag mapper replace "galmag" with "Fiction, General, Science Fiction, Short Fiction, Galaxy Magazine"

If you add the tag mapper button to a toolbar, then simply opening it and hitting OK will apply all the mapping rules to currently visible books.
Krazykiwi is offline   Reply With Quote
Old 02-14-2016, 10:58 AM   #9
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by fidvo View Post
You can have the best of both worlds if you set Calibre to not open text files natively. When you double-click the dummy file in Calibre, it would send it out to Windows to handle, which in your case would open it in Notepad2.
I use the open source Rocket Dock to keep frequently used programs in an auto-hide toolbar at the top of my screen, and Notepad2 is one. I was thinking of a shortcut that invoked it editing that file.

Quote:
A number of people have recommended having such a dummy file in Calibre for several purposes, including a placeholder for tags that aren't being used by any other books yet. I use one to store odd formats for configuring the Open With plugin. Funnily enough, most of these ideas don't really have any use for the actual contents of the file, which is what gave me the idea of using it for copy/paste snippets.
I'll have to play with the dummy file. I suspect there are a variety of uses beyond what I'd like to do.

Quote:
By the way, I prefer Notepad++.
I have it here, along with an assortment of other things that have Scintilla under the hood. (I collect text editors.) Notepad2 gets the nod for instantaneous invocation, the ability to set it to replace built-in Notepad, and the base subset of capabilities I need. Notepad++ is splendid, and I keep it up to date, but it does a lot of things I seldom need and is slower to invoke.

If I really want everything including the kitchen sink in an editor, I have Gnu Emacs installed as well.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-16-2016, 12:54 PM   #10
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
Quote:
Originally Posted by DMcCunney View Post
If I really want everything including the kitchen sink in an editor, I have Gnu Emacs installed as well.
______
Dennis
I'll bet you're hoping I use vi so we can turn this into a flame war over the best text editor. MUAHAHAHAHA!

Too bad. I don't use either.
fidvo is offline   Reply With Quote
Old 02-16-2016, 01:51 PM   #11
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by fidvo View Post
I'll bet you're hoping I use vi so we can turn this into a flame war over the best text editor. MUAHAHAHAHA!
Nope. I don't waste time on religious arguments.

Quote:
Too bad. I don't use either.
I use both, learned vi first, and prefer it for most editing I'm likely to do under *nix.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-16-2016, 02:26 PM   #12
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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)
Nonreligious: I can't think why anyone would use vi when vim exists.
eschwartz is offline   Reply With Quote
Old 02-16-2016, 06:47 PM   #13
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by eschwartz View Post
Nonreligious: I can't think why anyone would use vi when vim exists.
I first learned vi before Vim existed, and for the actual use I make of vim, it might as well be vi.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 02-17-2016, 10:24 AM   #14
Krazykiwi
Zealot
Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.Krazykiwi ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 2156958
Join Date: Jan 2013
Device: Too many random androids to list
All vi is good for is learning to type :wq! really fast, before you accidentally press something else and break your file. Or cause a singularity or trigger the inevitable zombie apocalypse or something worse.

Did you see my tip above about the built in calibre tag mapper? It really does work very well as a macro expander.
Krazykiwi is offline   Reply With Quote
Old 02-17-2016, 10:30 AM   #15
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Quote:
Originally Posted by Krazykiwi View Post
All vi is good for is learning to type :wq! really fast, before you accidentally press something else and break your file. Or cause a singularity or trigger the inevitable zombie apocalypse or something worse.
If you actually know what you're doing, dire consequences are unlikely. And you need to be root to really break something.

Quote:
Did you see my tip above about the built in calibre tag mapper? It really does work very well as a macro expander.
I did, and I'll be exploring it. It looks quite useful.
______
Dennis
DMcCunney is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FLP additions? John F General Discussions 20 07-07-2015 04:02 PM
Possible Additions? ParadiseLost Calibre 1 03-30-2013 02:01 AM
Dictionary additions kamanza Sigil 1 08-19-2012 04:39 PM
Macros obsidianchao Kindle Developer's Corner 0 07-13-2011 07:42 PM
iLiad Toolbar changes and additions M@rcel iRex Developer's Corner 2 09-04-2008 01:18 PM


All times are GMT -4. The time now is 01:54 PM.


MobileRead.com is a privately owned, operated and funded community.