Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-28-2012, 03:24 AM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Question automate stylesheet cleanup ?

to what extent can the process of:

open book with sigil
select remove unused stylesheet classes
accept results
save book

be automated

I'd like to do it with minimal (ideally no) mouse movements & actions

I'd really like to run it across an entire calibre library of books, but that may be too much to expect ?
cybmole is offline   Reply With Quote
Old 12-28-2012, 04:24 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Create a script with Autohotkey. That will work.
Toxaris is offline   Reply With Quote
Advert
Old 12-28-2012, 04:48 AM   #3
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
the "for dummies" version, please.

I've got only as far as assigning a keyboard shortcut in sigil, for "delete stylesheet classes".
there's no Sigil setting that I can see to turn off the need to confirm delete.
cybmole is offline   Reply With Quote
Old 12-28-2012, 06:49 AM   #4
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977556
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
@cybmole, if your on-screen setup is ALWAYS EXACTLY IDENTICAL, the easiest way is to use the autohotkey macro recorder to record your mouse-clicks. you can record a set of clicks, assign a hotkey to run that set of clicks on demand. It's not the most desirable way though, because if you move your screen elements the smallest bit, the cursor no longer clicks the hot-spot.

Very slightly more difficult is to script it to send key combinations, which are actually your assigned keyboard shortcuts (e.g. Ctrl C, etc), and these can include sending "Y" or "N" as a response to dialogs. The language and syntax for the "Basic" version 1.0.48 is pretty straight-forward, and the forum is quite helpful.

Then when you get hooked on the wonderfulness of AHK, you can design scripts to interact with specific (named) dialogs and windows.

Are you intrigued? I'd be glad to help if you decide to go with AHK, although I am off-line every weekend.
GrannyGrump is offline   Reply With Quote
Old 12-28-2012, 09:33 AM   #5
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
i'd prefer a solution using sigil preferences.

what would be helpful are 2 enhancements in future versions
1. an option to toggle off the confirm delete for "delete unused stylesheets" - so that a single hot key shortcut will do that operation
2. an option - within the pretty print/tidy options? - to delete unused classes before saving - which I think is a logical enhancement.

to clean all books in a folder would need some command line options ?
cybmole is offline   Reply With Quote
Advert
Old 01-08-2013, 10:04 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,510
Karma: 126422064
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
You can assign this to a function key. If a requester pops up because there are styles that can be deleted, then you will have to at least hit enter if you want them all deleted.
JSWolf is offline   Reply With Quote
Old 01-08-2013, 10:33 PM   #7
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,059
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Just carefully check the list of styles to be deleted. There is a small bug. Sigil will select pseudo elements for deletion even if you are using the primary style.
e.g.
p.first
p.first:first-letter
p.first:first-line
Sigil will delete first-letter/first-line even though p.first is being used.

Not a super big deal - how many people use pseudo-elements when they aren't supported very well...Just something to be aware of.
Turtle91 is offline   Reply With Quote
Old 01-09-2013, 06:23 AM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,441
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
"Bulk" file operations? Perhaps someday. But I don't see this one as being useful enough to become Sigil's very first. I've never gotten the vibe that Sigil was ever going to be anything other than a "one-job/one-epub" application. No confirmation and bulk file operations sound more like something you'd see with library management software. I could be wrong though ... and it wouldn't really concern me if I were.
DiapDealer is offline   Reply With Quote
Old 01-09-2013, 06:35 AM   #9
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by cybmole View Post
i'd prefer a solution using sigil preferences.

what would be helpful are 2 enhancements in future versions
1. an option to toggle off the confirm delete for "delete unused stylesheets" - so that a single hot key shortcut will do that operation
2. an option - within the pretty print/tidy options? - to delete unused classes before saving - which I think is a logical enhancement.

to clean all books in a folder would need some command line options ?
I agree. I see no problem with a selection in preferences to tun on/off this function.The user can dialup his/her own medicine.
crutledge is offline   Reply With Quote
Old 01-09-2013, 06:42 AM   #10
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
bulk operation: sure I'd only ever want to use it once, because I have over 1000 books which were collected before this feature was available. I was thinking of some batch process automation rather than changes to sigil for that but I don't know how to parameterise a command line / loop through a folder of books

I like the idea of cleaning them all, but not manually!

i think a preference setting to remove the need for a delete confirmation is reasonable though
cybmole is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automate Calibre Tagging ohemeffgee Library Management 1 11-11-2012 06:56 AM
Any way to automate editting metadata? louwin Library Management 4 04-24-2012 06:58 PM
Automate Trook Downloads (cron-like)? spedinfargo Nook Developer's Corner 5 06-01-2011 02:40 PM
How to automate Fetch News in Kindle? remei Calibre 0 02-04-2011 12:30 PM
I am looking for a tool that could automate convertion of... astra Workshop 24 08-30-2009 06:38 AM


All times are GMT -4. The time now is 12:00 AM.


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