eBook authors eBook Software - create and publish your own ebooks
Create your own eBooks
Learn How To Create, Publish & Market E-Books
E-Book Creation Software
Add sophisticated multimedia to your E-Books
Create E-Book covers in minutes
E-Book Marketing & Promotion made easy
Search engine for E-Books
Interviews with eBook authors
Tools for building better eBooks
Archived Message:

Using the OnLoad tag in an ebook

brainsci I would like to have ebook pages that open an executable (embedded in an ebook) as the page loads.

Here is the body tag that isn't working:

<BODY onLoad="##RUN('{ebook}\program.exe')">

Can anyone see what I'm doing wrong?
Or better, Can anyone tell how to do it right?

Many thanks in advance,

Posted on: 1:18 am on September 12, 2005
EBookCompiler onLoad requires JavaScript

RUN is Activ Script

So what you need to do is use the JavaScript/Activ Script integration: window.external.ActivRun

It's in the help

Posted on: 7:45 am on September 12, 2005
brainsci I'm afraid I don't know how to install an active variable.

The command seems easy enough, but how do I tell actve ebook to use it.

The help file says that a tutorial would be bigger than the help file itself.  There is no button to 'add'

Surely ther must be a way a newbie can add at least one of the predefined active variables.

This is the only one I need to add.

Would you consider adding a couple of "aep" files that have active scripts already installed to the website.

An example or two woudl be very halpful, now that you have told me script ( window.external.ActivRun ) I need to use.

Is there any way I, who am not a programmer, can get this installed in my ebook?


Posted on: 6:41 pm on September 12, 2005
EBookCompiler In JavaScript, inside a SCRIPT tag you could use do


The double \ is necessary because it's JavaScript escaping for a \

Posted on: 6:54 pm on September 12, 2005
brainsci Is this is the script I need (Yes, it was in the help)?

window.external.ActivRun('{ebook}\\PROGRAM.EXE') ;

I saved the script above to a text file called OnLoad.as .

But how do I set it to run when a page is opened?  The same OnLoad tag still gives an error when I run it like this:

<BODY onLoad="##RUN('{ebook}\OnLoad.as')">

I need to have this work for specific pages, not when the ebook is opened.

I appreciate your help with this.

I do not know programming, but I can figure things out - especially when they bear any resemblance to installing javascripts.

Posted on: 7:41 pm on September 12, 2005
EBookCompiler Try


OnLoad= must contain javaScript code

Posted on: 10:18 pm on September 12, 2005
brainsci It worked!!

For Newer-bies than myself, here's the final instruction:

Replace <BODY> (in the code for the page for which you want an exe to open as the page loads) with this:

<BODY onLoad="window.external.ActivRun('{ebook}\\program.exe')">


You're a prince among programmers.

Note that this code will only work with executables (or batch files) embedded in the software.  Other variations are possible.

Posted on: 5:34 am on September 13, 2005

List All Archived Forums

Copyright © 2000-2018, Answers 2000 Limited.

With any business, it is up to the individual owner of said business to ensure the success of the business. You may make more or less than any sample figures or results that might be quoted on our web sites or other publications. All business involves risk, and many businesses do not succeed. Further, Answers 2000 Limited does NOT represent that any particular individual or business is typical, or that any results or experiences achieved by any particular individual/business is necessarily typical.

Disclosure: Our company's websites' content (including this website's content) includes advertisements for our own company's websites, products, and services, and for other organization's websites, products, and services. In the case of links to other organization's websites, our company may receive a payment, (1) if you purchase products or services, or (2) if you sign-up for third party offers, after following links from this website. Unless specifically otherwise stated, information about other organization's products and services, is based on information provided by that organization, the product/service vendor, and/or publicly available information - and should not be taken to mean that we have used the product/service in question. Additionally, our company's websites contain some adverts which we are paid to display, but whose content is not selected by us, such as Google AdSense ads. For more detailed information, please see Advertising/Endorsements Disclosures

Our sites use cookies, some of which may already be set on your computer. Use of our site constitutes consent for this. For details, please see Privacy.

Click privacy for information about our company's privacy, data collection and data retention policies, and your rights.

Contact Us    About and Terms Of Use    Privacy    Advertising/Endorsements Disclosures