eBook authors eBook Software - create and publish your own ebooks
Create your own eBooks
 
   
EBookApprentice.com
Learn How To Create, Publish & Market E-Books
 
   
EBookCompiler.com
E-Book Creation Software
 
   
EBookPower.com
Add sophisticated multimedia to your E-Books
 
   
CoverFactory.com
Create E-Book covers in minutes
 
 
  EBookSubmit.com
E-Book Marketing & Promotion made easy
 
  EBookJungle.com
Search engine for E-Books
 
  EBookInterviews.com
Interviews with eBook authors
 
  EBookEnhance.com
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:
[code]
window.external.ActivRun("#!name_of_script_file.as";
[/code]

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:
[code]
STREMPTY('empty1','{INIKeyName}')
IF( NOT({empty1}) )
 INIREAD('userFirstName','{app}\filename.ini','{INIKeyName}','FirstName')
 INIREAD('userLastName','{app}\filename.ini','{INIKeyName}','LastName')
 INIREAD('userEmail','{app}\filename.ini','{INIKeyName}','Email')
ENDIF
[/code]

You can easily use the same code directly on Javascript, for example in a function:
[code]
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";

window.external.ActivRun(as);
}
[/code]


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.

Carlos

(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(){

window.external.ActivSet('flg','0');

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";

window.external.ActivRun(as);

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}

[MYeBook]
mydata=Last Name
registration=12228

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.

rlemire


Posted on: 10:18 pm on June 25, 2003
Carlos Try to escape the "\" character on the path:
[code]
c:\\windows\\system.ini
[/code]

Also the var {title} must have a value.

Carlos


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

Go to Active Discussion Thread

Participate in Current/New Discussions

List All Archived Forums



Copyright © 2000-2015, 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.

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