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 09-27-2013, 05:29 PM   #1
gabby98
Wizard
gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.
 
gabby98's Avatar
 
Posts: 1,751
Karma: 2667650
Join Date: Jul 2012
Device: Android, Nook Simple Touch, Nook Color, ..., Glo
Save to Disk If or Select Statement

I thought I'd seen something similar listed here before, but I cannot find it atm....When I use the save to disk option, if there a way to use an if or select statement in the save template.

For example, I have some files that I may attribute to a collection so I would want them saved as Collection/Title

but other wise I would want them saved as author/series info/title

Any point in the right direction is greatly appreciated
gabby98 is offline   Reply With Quote
Old 09-27-2013, 06:20 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,724
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by gabby98 View Post
I thought I'd seen something similar listed here before, but I cannot find it atm....When I use the save to disk option, if there a way to use an if or select statement in the save template.

For example, I have some files that I may attribute to a collection so I would want them saved as Collection/Title

but other wise I would want them saved as author/series info/title

Any point in the right direction is greatly appreciated
@gabby98 - I think you'll need to use Program mode template - see attachment for how to get there - use the 'help links' at bottom of dialogue window to see relevant pages in manual

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	212
Size:	100.9 KB
ID:	112289  
BetterRed is online now   Reply With Quote
Advert
Old 09-27-2013, 09:53 PM   #3
gabby98
Wizard
gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.
 
gabby98's Avatar
 
Posts: 1,751
Karma: 2667650
Join Date: Jul 2012
Device: Android, Nook Simple Touch, Nook Color, ..., Glo
Quote:
Originally Posted by BetterRed View Post
@gabby98 - I think you'll need to use Program mode template - see attachment for how to get there - use the 'help links' at bottom of dialogue window to see relevant pages in manual

BR
Thanks BR...I had looked at that but for some reason the second time around helped me figure it out.

FWIW I ended up using

Code:
{#collection:test([Collection] {#collection}/{title}/{title},{author}/{#myseries2}{series}/{series_index:0>2s} {title}/{title})}
gabby98 is offline   Reply With Quote
Old 09-28-2013, 02:57 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by gabby98 View Post
FWIW I ended up using

Code:
{#collection:test([Collection] {#collection}/{title}/{title},{author}/{#myseries2}{series}/{series_index:0>2s} {title}/{title})}
That template can break in mysterious ways because it uses subtemplates, something that doesn't work well in single function mode templates. As the documentation says: Do not use subtemplates (`{ ... }`) as function arguments. Instead, use template program mode and general program mode.

I would use general program mode for this. Something like
Code:
program:
	test(
		field('#collection'), 
		template('[Collection] {#collection}/{title}/{title}'),
		template('{author}/{#myseries2}{series}/{series_index:0>2s} {title}/{title}')
	)
chaley is offline   Reply With Quote
Old 09-28-2013, 12:50 PM   #5
gabby98
Wizard
gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.gabby98 ought to be getting tired of karma fortunes by now.
 
gabby98's Avatar
 
Posts: 1,751
Karma: 2667650
Join Date: Jul 2012
Device: Android, Nook Simple Touch, Nook Color, ..., Glo
Quote:
Originally Posted by chaley View Post
That template can break in mysterious ways because it uses subtemplates, something that doesn't work well in single function mode templates. As the documentation says: Do not use subtemplates (`{ ... }`) as function arguments. Instead, use template program mode and general program mode.

I would use general program mode for this. Something like
Code:
program:
test(
field('#collection'), 
template('[Collection] {#collection}/{title}/{title}'),
template('{author}/{#myseries2}{series}/{series_index:0>2s} {title}/{title}')
)
I'll take another look ty
gabby98 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save on disk PhM Calibre 1 06-13-2011 12:43 PM
Save to Disk beckywc Library Management 3 06-06-2011 08:54 PM
Save to disk add on? Jabby Calibre 1 08-29-2010 03:45 AM
Save to disk question Jabby Calibre 2 08-25-2010 12:09 PM
Feature request: Select what file format to save RSS into haridasi Calibre 2 08-23-2008 10:03 AM


All times are GMT -4. The time now is 07:49 PM.


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