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:

How to Hide Your Scripts

Carlos Hi,

Activ E-Book allows you to run Activ Script files by calling them from JavaScript using:

But as Activ Script files are not encrypted any user with some knowledge can easily 'steal' them. Unfortunately this already happened to me.

So, I tried other methods and found that you can use the code of your Activ Script file directly on your html files with JavaScript (or VBScript). This is really great as you can encrypt the html files and that decreases the possibility of someone steal your source code.

Here's an example:

If you have the following instructions in a Activ Script file:
IF( NOT({empty1}) )

You can easily use the same code directly on Javascript, for example in a function:
function getUserInfo() {

var as = "##STREMPTY('empty1','{INIKeyName}')";
as += "##IF( NOT({empty1}) )";
as += "##  INIREAD('userFirstName','{app}\\filename.ini','{INIKeyName}','FirstName')";
as += "##  INIREAD('userLastName','{app}\\filename.ini','{INIKeyName}','LastName')";
as += "##  INIREAD('userEmail','{app}\\filename.ini','{INIKeyName}','Email')";
as += "##ENDIF";


Some Notes:
1. You cannot use "REM" as it gives "Unknown command" error.
2. You must 'escape' some characters like "\".

A question for Sunil: Is there any problems or concerns using this method?

Hope this helps someone.


(Edited by Carlos at 8:39 am on June 25, 2003)

Posted on: 6:44 pm on June 23, 2003
EBookCompiler I can't see any obvious flaw with it - if you tested it, and it works, then great!  The JavaScript escaping is probably the only issue that will confuse some people trying to copy this idea (but I see no reason why it should interfere with the idea in principle).

I don't think REM works, for the same reason it doesn't work if you write
[A HREF="##REM *** "]

The REM means to the end of the current line, which is fine in a script file, but doesn't make sense when embedded in a command line this

Posted on: 10:47 pm on June 23, 2003
Carlos Thanks Sunil.

(Edited by Carlos at 9:02 am on June 25, 2003)

Posted on: 9:01 am on June 25, 2003
rlemire Hi Carlos; Your script looked like a real problem solver for me, but I can't get your system to work for my script. Below is my script. This script works fine in an "as" file being called through JavaScript as **window.external.ActivRun('#!myASfile.as') ; **

function Test(){


var as = "##FILEEXIST('flg','c:\windows\system.ini')";
as += "##IF ( {flg} = 1 )";
as += "##INIREAD('data','c:\windows\system.ini','{title}','mydata')";
as += "##INIREAD('regcode','c:\windows\system.ini','{title}','registration')";
as += "##ENDIF";


theFlag = window.external.ActivGet('{flg}');
theData = window.external.ActivGet('{data}');
theCode = window.external.ActivGet('{regcode}');

alert (theFlag);
alert (theData);
alert (theCode);


*The file --- c:\windows\system.ini  **** [MYeBook] is the {title}

mydata=Last Name

The literal contents of the alert returns are

alert (theFlag); = 0
alert (theData); = {data}
alert (theCode); = {regcode}

I've tested this extensively, trying both "reads" and "writes" but the script does not access the "system.ini" file. It would be handy to be able to use your system. Can you think of any reasons it doesn't work.


Posted on: 10:18 pm on June 25, 2003
Carlos Try to escape the "\" character on the path:

Also the var {title} must have a value.


Posted on: 12:20 am on June 26, 2003
rlemire Thanks Carlos; That solved the problem. Now your system works like a dream and helped eliminate 8 "as" files.

Now if only I could find out how to return a variable to my Activ eBook from an online database.

Posted on: 8:49 pm on June 27, 2003

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