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 05-27-2011, 02:36 AM   #1
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
Macro/script functionality

Since Valloric will not implement a macro or scripting option to Sigil, does anyone know an alternative.

I have a very extended macro in Word for correcting standard (scan)-errors in documents and most rules are already applied to my epubs. However, I would like to run at least the newer rules also to my epubs to make corrections.
I wouldn't like transforming them back to word document and then recreate epubs again, way too much work. Has anyone a solution for this that is workable?
I could live with extracting an epub, running the macro/script and than repack the epub.
Toxaris is offline   Reply With Quote
Old 05-27-2011, 04:28 PM   #2
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Toxaris: we use NoteTab Pro for this, which allows for very sophisticated macro/scripting options--when necessary, we extract, run the script, repack...altho obviously, we try to ensure we've run them all BEFORE we build the epub. ;-)

NT Pro is the best thing since sliced bread--it really is. I don't use 1/10th of its capabilities, but lots of my Crewmembers do, who have mightier fu than I. I honestly don't know how I lived without it before Cap (capidamonte--remember him?) turned me on to it.

Hitch
Hitch is offline   Reply With Quote
Advert
Old 05-30-2011, 07:42 AM   #3
LGN
Connoisseur
LGN is on a distinguished road
 
Posts: 88
Karma: 60
Join Date: Oct 2010
Device: ProMedia eReader, Sony PRS-600
No macro/scripting is a pity as it would be useful to make templates for different things where I now use copy/paste/replace a lot to do some tedious tasks that are recurring often.

If only Sigil would make its features available through command line maybe it could become a sort of compromise, having an external batch script handle some common tasts. (Maybe in combination with Calibre)

me crosses fingers
LGN is offline   Reply With Quote
Old 05-30-2011, 12:53 PM   #4
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 Toxaris View Post
Since Valloric will not implement a macro or scripting option to Sigil, does anyone know an alternative.

I have a very extended macro in Word for correcting standard (scan)-errors in documents and most rules are already applied to my epubs. However, I would like to run at least the newer rules also to my epubs to make corrections.
I wouldn't like transforming them back to word document and then recreate epubs again, way too much work. Has anyone a solution for this that is workable?
I could live with extracting an epub, running the macro/script and than repack the epub.
Could the macros be redone as regex? A lot of work but probably worth the effort.
crutledge is offline   Reply With Quote
Old 05-30-2011, 03:44 PM   #5
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
It is mostly RegEx, some 30 of it. It is kind of tedious to do this for all my current and future epubs, hence the macro/script option.
Toxaris is offline   Reply With Quote
Advert
Old 05-30-2011, 06:20 PM   #6
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 Toxaris View Post
It is mostly RegEx, some 30 of it. It is kind of tedious to do this for all my current and future epubs, hence the macro/script option.
I

Grep (e.g. PowerGREP) can apply the regexes to multiple files simultaneuosly. I use PowerGrep to open epubs and apply changes to all .xhtml files. I have never tried multiple epubs but it might be worth a try. I can symathize.
crutledge is offline   Reply With Quote
Old 05-30-2011, 10:58 PM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
I don't know if I'm just dense, but...NoteTab Pro does this; just open all the xhtml files in an epub simultaneously after you've exploded the epub and regex across all of them, by selecting "all files," it's NBD. ???

HTH,
Hitch
Hitch is offline   Reply With Quote
Old 05-31-2011, 04:26 AM   #8
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 Hitch View Post
I don't know if I'm just dense, but...NoteTab Pro does this; just open all the xhtml files in an epub simultaneously after you've exploded the epub and regex across all of them, by selecting "all files," it's NBD. ???

HTH,
Hitch
Sounds great. The thing about a grep is that it will/should open multiple epub files simultaneously and apply regexes to each. A batch operation. Just be very sure of the regexes.
crutledge is offline   Reply With Quote
Old 05-31-2011, 05:44 AM   #9
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
NoteTab is definatly good at this sort of thing but does it fully support UTF-8?

Last time I used it (admittedly it was a long time ago), this functionality was not there and it gave me many problems with using curly quotes and other characters. I ended up stopping using it and just resorting to using simple macros in Notepad++
ghostyjack is offline   Reply With Quote
Old 05-31-2011, 06:13 AM   #10
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by ghostyjack View Post
NoteTab is definatly good at this sort of thing but does it fully support UTF-8?

Last time I used it (admittedly it was a long time ago), this functionality was not there and it gave me many problems with using curly quotes and other characters. I ended up stopping using it and just resorting to using simple macros in Notepad++
Within reason. It's not a native unicode editor. If the text fits within a single ASNI code page, supported by Windows (assuming that's what we're talking about here), then it'll work; if the characters are based on a code page not supported by your own Windows system, it wil fail to convert.

However, given the massive advantages that NTP has over NotePad, I tend not to worry about it. The clip library alone is worth its weight in gold; there are thousands of user-contributed clips available in the website clip-library, hell, I love the damned thing. I haven't really had any problems, particularly with curlies and the like (of course, I tend to convert to named entities whenever possible, due to reading-device weirdness and uniquities.)

Is it perfect? No, but the ability to open an entire directory of files and regex across it all at once (and UNDO them all, if needed)...man, hard to beat that. Coupled with the rather endless clip libraries, so I can maintain a library of my own oft-used regex...just love it. Create outlines, FTP script commands, CSS cheatsheets in one library...(euro exchange rates, which is a hoot)...and, here's the thing: it's CHEAP.

HTH,
Hitch
Hitch is offline   Reply With Quote
Old 05-31-2011, 11:34 AM   #11
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 Hitch View Post
Is it perfect? No, but the ability to open an entire directory of files and regex across it all at once (and UNDO them all, if needed)...man, hard to beat that. Coupled with the rather endless clip libraries, so I can maintain a library of my own oft-used regex...just love it. Create outlines, FTP script commands, CSS cheatsheets in one library...(euro exchange rates, which is a hoot)...and, here's the thing: it's CHEAP.

HTH,
Hitch
Maybe I can turn you on the EditPadPro. It does everything you have mentioned but also will operate fully in utf-8. A little more expensive, though.
crutledge is offline   Reply With Quote
Old 05-31-2011, 02:35 PM   #12
FatDog
Witless protection Agent
FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.
 
Posts: 290
Karma: 1002898
Join Date: Nov 2009
Location: Los Angeles
Device: Kindle
Check out "JEdit" as an editor alternative. It is available on PC, Mac and Linux, written in Java and exposes it's "JavaBean" language as the macro language and it is free. It can auto detect encodings but you can set the default to UTF-8, UTF-8Y, UTF-16, UTF-16BE... (and a bunch of others).

JEdit lets you define a macro by recording/typing your commands/stop recording. The exact commands are then in a new buffer which you can save, edit, run, etc.

I can understand why Sigil wont have a macro language. It will be the number-one source of bugs and complaints for years and wont work really well and will double the documentation needed (You have to document a new language - another daunting task). The only time Macro languages work well is if the macro language is written first, then the editor built using the macro language. I suspect Sigil would have to be re-written from the ground up to do it right.
FatDog is offline   Reply With Quote
Old 05-31-2011, 03:40 PM   #13
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
Oh, don't get me wrong. I don't blame Valloric at all. I understand his reasoning and what he has made so far saved me a lot of time already.

Well, I got some pointers...
Toxaris is offline   Reply With Quote
Old 06-02-2011, 07:31 AM   #14
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by Toxaris View Post
Since Valloric will not implement a macro or scripting option to Sigil, does anyone know an alternative.
Who says I won't implement a scripting option? There was a thread a while back about adding a scripting language to Sigil, and I agreed it was a good idea. I wanted to bring in Python. But other needs came first, and this feature was postponed.

It's still very much an idea I look forward to implementing. My current idea for Sigil's future is to get it to an "IDE for epub" state; power users need the power, but you still need to keep things simple for the average user.

I still think about this feature every now and then. The scripting language will probably be pure JavaScript since Nokia is pushing it hard as "the" scripting language for Qt apps. So there's support for it directly in the framework.

Frankly, it shouldn't be too hard to leverage the Qt JS support and build a scripting framework on top of it in Sigil. Pretty much all I'd need to do is provide an API for accessing the text of all the content files in the epub, and then let people use raw JS functionality on top of it for whatever work they need done. With raw access to the content of all the files, you can get a lot done. A nice UI for this will be most of the work; a new "Scripts" side pane (kind of like a Book Browser, but for scripts) and buttons/menus/actions for running the code. Editing the scripts would just be new tabs in the main pane.

Further on, I'd need to add API's for file creation/renaming/moving etc within the EPUB archive, but that wouldn't be too hard.

Since JavaScriptCore is the JS engine used in Qt and JSC use PCRE internally for regex functionality, this would indirectly bring an oft-requested feature to Sigil.

All of this shouldn't take more than a week to add to Sigil, but I can't dedicate that time to this feature right now. There are more important issues in the queue, not the least of which is getting 0.4.0 stable. But if someone else expressed a desire to work on this feature, well... they'd have my full support.
Valloric is offline   Reply With Quote
Old 06-02-2011, 01:02 PM   #15
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
Actually, you said for issue 581 that you didn't like the idea of macro possibilities and set it to 'won't fix'. Therefore I assumed that it wouldn't be implemented...

Believe me, I would help if I could. However, I never got by rather basic Delphi programming years ago...
Toxaris 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
Word 2007 macro scoplar Workshop 1 05-21-2011 05:00 AM
macro - Search and Replace oldbwl Workshop 17 03-05-2011 01:39 PM
Word Formatting Macro (Stingo's Macro) Stingo Sony Reader 75 08-24-2010 05:18 AM
Spelling Macro PieOPah Workshop 36 12-13-2008 02:27 AM
Emdash - punctuation macro ProDigit Sony Reader 8 11-28-2008 02:32 AM


All times are GMT -4. The time now is 02:36 PM.


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