01-16-2009, 01:29 PM | #1 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Using WindowScript to product IMP files
I ported Nicks command-line based script word2imp.pl (a perl script to Windows script --javscript) to facilitate the conversion of doc directly into .IMP format; bypassing the need for the eBook Publisher GUI.
About the script Word2IMP.js Converts MS Word document to IMP Microsoft windows scripts can be written in VB Script or JavaScript, I wrote this in JavaScript. RUNNING THE SCRIPT Two methods 1) Command Line: type Code:
cscript Word2IMP.js <Your MS Word file name> Drag and Drop your MS Word document on the Word2IMP.js script. To use the Window Script you need ePublisher 1. You have previously installed the eBook Publisher software from http://www.ebooktechnologies.com/sup...r_download.htm . No other software is needed since Window scripts have been part of the MS OS since Windows 2000. Thanks NICK =X= PS If folks find this script useful and would like to see NICK's excellent Perl work ported to Window Script* just let me know WindowScripts can be written in VBScript or JavaScript. Last edited by =X=; 01-20-2009 at 02:13 AM. Reason: Clarification |
02-12-2009, 05:56 PM | #2 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Also, I just released a PowerPoint .ppt to .imp Perl script called PPT2imp.pl. Could you convert that to javascript too? Thanks for helping me understand the power of javascript built into my OS (WinXP SP3). |
|
Advert | |
|
02-12-2009, 08:40 PM | #3 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
I'll take a look over the weekend and see what I can come up with
=X= Last edited by =X=; 02-13-2009 at 01:12 AM. |
02-19-2009, 06:04 PM | #4 |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Quick status nick. I've gotten your first request completed. I have the code that will display a "File Open" dialog box. And a simple GUI for the javascript.
The UI is nothing more than a call to IE ActiveX control with hand written HTML. Since this is test code I've not integrated it with the word2imp script. OH a FYI. I found some of my old scripts, where I used the Windows Scripting Host (WSH) written in Perl. It provides all the power that VBA and Javascript have but in Perl. The disadvantage is that it requires ActivePerl. I'll post the finish code here when it's done. =X= |
02-19-2009, 07:21 PM | #5 | ||
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Quote:
Do you think it would be worthwhile to also have the Microsoft Visual Basic example scripts from the SBPubX.doc posted here as well. I know you've converted the above to javascript, but would there be any benefit to using MS Visual Basic, GUI-wise? |
||
Advert | |
|
02-20-2009, 01:09 PM | #6 | |
Wizard
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Quote:
I quit using it since VB 6. But if you used the Net platform you could easily write a GUI with Basic/C#/JScript... you get my point . The bad news is I have do not programming experience with the NET framework, which is what MS currently supports. =X= |
|
02-20-2009, 02:49 PM | #7 | ||
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Anyone have VB (with GUI) programming skills? Quote:
Anyone care to help get us started with a simple sample .vbs/.net? I'll surely hack at it if it doesn't quite do what it should; I just need a something to start with... thanks! |
||
02-20-2009, 03:08 PM | #8 | |
Grand Sorcerer
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
Quote:
BOb |
|
02-20-2009, 04:59 PM | #9 | ||
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Quote:
Code:
fileFullPathName = oArgs.item(0); Code:
project.AuthorFirstName = "Default Author"; project.BookTitle = "Default Title"; project.Category = "Default Category"; Code:
project.BuildTarget = 2; That's it! Really would help us get started though... Last edited by nrapallo; 02-20-2009 at 05:02 PM. |
||
04-19-2009, 08:33 AM | #10 |
Member
Posts: 21
Karma: 272
Join Date: Dec 2007
Location: Romania
Device: ebookwise 1150
|
I have some knowledge in visual basic but my experience with visual basic express 2005 or 2008 was not satisfactory. On my laptop with only 512 MB of RAM visual express is working very, very slow. So I looked for alternatives and I found AutoIT a basic like scripting language. I will post soon a little script that achieve those things asked by nrapallo.
|
04-20-2009, 10:33 AM | #11 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Here is a sample GUI layout I was looking at using before: And a while back, I was even toying with an Internet Explorer V6 interface, as seen below: Last edited by nrapallo; 04-23-2009 at 10:23 AM. Reason: added more screenshots |
|
04-21-2009, 02:50 PM | #12 |
Member
Posts: 21
Karma: 272
Join Date: Dec 2007
Location: Romania
Device: ebookwise 1150
|
a bit of succes
Hi
Well, AutoIt support operations with COM objects but like you will see it's a little bit tricky to manage that. First I tried to do everything in a single script but... surprise... when I want to catch the OnBuildStart event using BuildFromWordDoc the result is... nothing. The event is not firing my function in AutoIt for overriding default project settings. I can catch this event if I use BuildFromHtmlFile but surprise again... the default projects settings are used despite of what I do in my function. I think AutoIt have some problems with some events with some COMs... especially with SBPublisher COM. So I decided to write only a GUI wrapper for word2imp.js first. Here are the results. First the source file (contains the autoit script and the jscript) Second, the executable (contains the compiled autoit executable and again the jscript) |
04-21-2009, 03:24 PM | #13 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
I tried to run the executable but got a Spybot false positive detection of malicious code (see attached picture). Spybot then deleted the file. Is this a known problem? What did you use to create the .exe. I'll try creating another .exe to see if it does the same thing. Weird. Last edited by nrapallo; 04-21-2009 at 07:06 PM. Reason: false positve |
|
04-21-2009, 03:34 PM | #14 |
Member
Posts: 21
Karma: 272
Join Date: Dec 2007
Location: Romania
Device: ebookwise 1150
|
false pozitive
|
04-21-2009, 03:40 PM | #15 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
I did compile the script and got the same (false) Spybot warning. OK now that we know the .exe is ok, why doesn't it open the .doc file and convert it. I get the error in the second picture below (on a Win XP SP3 system with Word 2003 installed). Last edited by nrapallo; 08-15-2009 at 09:44 AM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
eBookwise: IMP vs. RB files | Jack B Nimble | IMP | 10 | 11-05-2008 09:22 AM |
rb files and imp files | Wordcrasher | IMP | 2 | 10-20-2008 06:37 PM |
Use two fonts in imp files? | Moonraker | IMP | 3 | 04-10-2008 06:46 PM |
Anyone know how to convert IMP files | jckatz | Sony Reader | 1 | 01-23-2008 12:19 PM |
how to read imp files? | roquet | Reading and Management | 6 | 11-10-2007 03:27 AM |