Source language: Translate to:

Web Browser Object able to call Neobook Actions?

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Web Browser Object able to call Neobook Actions?

Postby Jim Brammer » Thu Feb 07, 2002 5:41 pm

Any of Plugin Developers that are famaliar with MMB so I have a question for you.. Are you familiar on how MMb is able to Run MMB Scripts from an HTML page. They have that little piece of custom code that they add to the HREF tag in your html the when clicked in a HTML Page it will call an action in MMB.

Do think this would be possible to do with Neobook where you have the Web Browser Object be able to call Neobook Action similiar to what Jay says has his new Flash Plugin can do.

This would be awesome but would probably require Dave to add this function to the Web Browser Object built into Neobook or a whole new Web Object Plugin would probably have to be created..

This kind of goes back on the idea about the Scrolling Neobook Page I asked about in a previous. Jim actually got a sample to work based on this question.

The thing is I have large amount of information that needs to be organized in categories and many sub categories. It the past the I have designed these projects in HTML as it worked the best grapically and easy to organize and loaded well. I would just make a splash with MMB and have it load the HTML Pages into Internet Explorer. The thing that was missing is having the Web Pages be able to launch .exe files for me...

I am just throwing up some ideas, the other is a tree like menu that Leif was working on before would also work great for organizing large amounts of info...

Any suggestions pro' s are con's please reply..



Polaris


What do you think.


<hr>


Polaris,

It's not as simple as it looks. I'm not sure the way Jay will enable Flash actions to be 'supersede' by NeoBook action scripts, unless you need to modify the Flash action to allow NeoBook commands to be executed. Flash has 'fscommand' which is like DOSCommand, so you can call any NeoBook command..

But for HTML.. unless there is a way to call external program, then it may be possible. Perhaps through JAVA scripts or something to that extent..

You may like to try out the wildest possibilities in mind.. do some HTML and add some 'links' that has NeoBook command... place this HTML into your NeoBook PUB.. run it, then click at the link.. and see whether the command works...

If it does.. there's no need for plugins..

Rgds
Ronnie
'MMB Evangelist' since v1.2



<hr>


I will put some Neobook actions in HTML code and it might work???? That would be a miracle to all the the Neobook followers..  haaa haa

Polaris


<hr>


There is something to this that makes me want to say yes you can pull it off. But I'm not sure. It will take some trickery. I have been wanting to try this but with everything else going on I keep forgetting to do it. There is a way to make an href link that will cause the browser to go absolutely nowhere *and* cause no error. But, it will change the link in the location bar. I've seen it, even done it by mistake, but can't remember right now what it is to explain it. Anyway, I was thinking that I could look to the WebBrowser variables to pick up what the changes are.

Variable to Store Current Address
[WebBrowser1Addr]


The "Download Complete" action tab could be used to look at the [WebBrowser1Addr] var to determine what to do. Something like...

If [WebBrowser1Addr] = "whatever_url_1"
Run ABC.EXE
EndIf

If [WebBrowser1Addr] = "whatever_url_2"
Run XYZ.EXE
EndIf


Treat it the same as you would a MenuEx !

Like I said, I haven't done this but has been something I've been meaning to try. The real trick is finding what URL to use. You could always send the browser to a specific page I suppose, but I think it would be cool to run things without having to leave the current page.

If I can find or remember what href or form link it is that does this I'll post it here.

Does anyone else know??

jim

<hr>


This is not the URL thing that I was trying to remember but could work as well.
A person could add HTML Targets beside each link...

{a NAME="ABC">{/a>{a href="#ABC">Launch ABC Program{/a>

{a NAME="XYZ">{/a>{a href="#XYZ">Launch XYZ Program{/a>


That will cause the URL to change, but stay within the same page. The page will of course jump to where the target is so you might have to move them around on the page or something...

just a thought

jim

<hr>


Correction...

You might want to use the "Before Navigate" action tab instead of the Download Complete. Depends on what you're trying to do I suppose.

jim

<hr>


Hello all,
Yes it can be Done and here is How:

First Thanks to Jim for the right direction, his script will not work as it is but if we altered the scrip a little bit we will get it to work and here it comes.

get the Source Pub here....

http://www.1800mns.com/files/web.zip

unzip the file and Move test.htm to C it should look like C test.htm then open in Neobook and run now click on the links in the browser and Voila,,....

things to remember:

1. in your HTML Link always use # before the variable you want,in our example it looks like this:

test

Note the Character # before jay..

why do we have to use that and not just jay.htm, well it 's because the browser will show a dead link if you use jay.htm ,it will think that you are going to a page called jay.htm but when you use the #jay then the browser Object will not navigate outside the page which will give us what we want ...cool

I Hope you like it.

Oh Yah all the scriot you need in in the Browser Object just right click on it and click on action and you will see all in there. just add you own variables there.

Jay.


<hr>


Errrrr the board changed the script formatting ..

instead of test it should look like this

{a heref="#jay">test{/a>

i hope that works...

jay


<hr>


I give credit to both of you!!! Actually you guys came up with a great idea. I tried out your sample Jay and it worked like a charm!! I had launch some programs and it worked great. I now need to rethink my project I am currently working on I see how this new feature can be incorporated. This is has me thinking of all kinds of possibilities..  


My only question is would there be any drag on speed or resources if you had lets says 50 statements like this???

If "" "=" "#jay"
Run "notepad.exe" "" "Normal"
EndIf


Thanks for the Help and Ideas,
Polar

<hr>


Errrrr the board changed the script formatting ..

Jay and did the samething... you guys get the idea...


If "url" "=" "#jay"
Run "notepad.exe" "" "Normal"
EndIf


<hr>


No It Shouldn't drain down your resources because it is not a timer or anything so it will go down the list untill the end, it wouldn't effect the system resources at all..

later.

jay


<hr>


Polaris,

Don't laugh...  A wildest idea may spark some thoughts in somebody... and I'm glad that both Jim & Jay is able to make it happened, whether it's coincidental or not.

It is a fact of life esp. for me - I usually think wild first... many times to the extreme about how a task can be done. Than I start figuring it out based on this wild idea.. and along the path, I modify the idea a little.. and sometimes, I get what I want.. if not better... And in the end, the wild idea is not wild afterall..

Try it... it works. You'll never know unless you try it... there's more to it than meets the eye... in our thoughs and the things we do...

Rgds
Ronnie


<hr>


Can the Web Browser Object handle ASP code?
I gave it a small try, but it does not seems to be able to do it.
Anybody knows for sure it it is supposed to work?
Because if it does, then working towards a database would be possible and with the full SQL power in our hands.


<hr>


Yeah...!
Running it from the IIS, ASP works.
Giving the address instead of path in "Internet Address or HTML File:" etc.....
This, with the possibility to run NeoBook commands from the browser gives us a lot of possibilities..
Could someone please buy me a few weeks of time.... :-)

<hr>


Thanks Jay! That's the link type I was trying to remember! When I found it out I was into something a little more complicated. Writing a js routine I kept screwing up my array. My destination was being truncated and sent the #target to the location bar. No errors. No page movement. I thought it was interesting and could be used somehow but at the time didn't know where... Until Nbk4 came out.

Glad it worked for ya...

jim

<hr>


Just paste a little code and try out a couple of idea's see what happens. The thing is I just asked the question the Jay and Jim figured it out. I was up late last night so I didn't have time to go play with it. I am going to go try putting it some cool JavaScript Menus and see how it works.

LASwe and see the wheels are turning in your head also. New ideas!!!!!!

Polaris


<hr>


"My only question is would there be any drag on speed or resources if you had lets says 50 statements like this???"

If "" "=" "#jay"
Run "notepad.exe" "" "Normal"
EndIf



Polaris,

Maybe not on resources - but it can get slow in process time if you have a lot of If/EndIfs. What you might want to do is add a GotoLine "linename" just before each of your last EndIf's. Like this...


If "" "=" "#jay"
Run "notepad.exe" "" "Normal"
GotoLine "Skippy"
EndIf

If "" "=" "#jim"
Run "wordpad.exe" "" "Normal"
GotoLine "Skippy"
EndIf

If "" "=" "#ronnie"
Run "calc.exe" "" "Normal"
GotoLine "Skippy"
EndIf

(etc)

... (at the very bottom of the action editor)
:Skippy


...and so on. This way once a condition is found true and has been enacted upon, all the rest of the If/EndIf's are skipped resulting in faster process time. If "#jay" is true then jim and ronnie will be skipped. Even though each other condition is false, it's still checked. Watch your debugger and you'll see what I mean.


<hr>


Last night I was up late and tired. I didn't really mean system resources, I was thinking process time slow down while the Neobook Application while it went through all those IF THEN statements that would be noticable to the end user. I like your idea of jumping to the end once it found the statement true.

I guess the only way to see if slows down is to try it out?? Who knows it could be just fine and work fast!!!

I will test


Polaris


<hr>


They are two ways to do it :

1. is Like Jim explained above you use that option if you have more script at the end of your Code that you want to process : for example ..

If "" "=" "#jay"
Run "notepad.exe" "" "Normal"
GotoLine "Skippy"
EndIf

If "" "=" "#jim"
Run "wordpad.exe" "" "Normal"
GotoLine "Skippy"
EndIf

:alert
AlertBox "Jay Says" "Alert!!"
:skippy
AlertBox "Jay Says" "skippy!!"

so basically what happens up there is when you execute the script and #jay was found then it show the alert box and then jumps to line :Skippy and runs everything after that... note how it ignores line :alert ..

the problem with that is when the pub starts these scripts get executed in other words when you run the pub you will see two alert boxes alert and skippy, again you only want to use GoToLine if you have more code you want to execute..at some point in your script. what ever the condition is .

2. Now if you want to only execute the code that's under the If Condition then use this :

If "" "=" "#jay"
Run "notepad.exe" "" "Normal"
Return
EndIf

If "" "=" "#jim"
Run "wordpad.exe" "" "Normal"
Return
EndIf

basically here when the condition is found it will run the script inside the if and stop there. using the return Function.

which will make it fast ...

i hope this helps.

Jay


<hr>


Can you use the RETURN action to basically end any Script. I usually put :end and the end of my script and then use the GotoLine if i needed to end prematurely which always seemed kind of sloppy.

I didn't know that there was a command for it?? I better read the help more thoroughly!!  

Thanks,
Polaris


<hr>


Yes that is Correct you use Return to end the Execution of a script just Like MMB...


Jay.


<hr>


Thanks Jay for the Tip!!  

Here is Another Example For Anyone who would like to call a large number of certain types of files so you don't have 60 or more IF THEN statements like i was looking at..

I will basically just be launching .exe and .zip files through HTML interface so this way will come in handy. And actally you can make the CALL Function Library be external file as Jim showed in a previous post. Use the CALL Function Library inside the BEFORE NAVIGATE option in the Web Browser Object and have Neobook create new External Function Library during runtime and have it write over the old one giving you the option to have your HTML pages launch different actions. Here is a link with an example if any interested.

http://members.home.net/nextmillenium/web.zip


The thing now is i am going to Have Neobook create and generate all the Links in a .HTM file during runtime from a list of files in a Neobook ListBox. The question is the process time it takes to do this. If its to slow on the fly on will have it generate when the Splash shows at the start. If process time still slow and will just make a seperate program to generate all index.htmf files.

Polaris


<hr>


Polaris

Now with this development, maybe you can try using an HTML file with image maps for making your scrollable interface ?

If it works then you have a scrollable interface in an embedded window.

regards - Paul


<hr>


Oops SOrry..

Didnt see your post on the other message. Guess you already figured that one out.

regards - Paul


<hr>


By adding some JavaScript it's also possible to send a parameter to NeoBook from the html page.
We can use Browsers staus text for this, small sample to download here: w1.555.telia.com/~u555042...p2/web.zip


<hr>


I checked out your sample and you figured out another way to send a parameters.. good job now we have 2 ways to send parameters or better yet send 2 parameters..  

Polaris


<hr>


You Can Also use the WebBrowserTitle to send parameters also. i have a problem pass the parameter when using the onclick= nothing happens??? The onmouseover works fine though. So maybe there is 3 ways to pass parameters???

"document.title='This Will Control The BrowserTitle.'; return true"

Polaris


<hr>


While we're talking about tree views and html...

http://neodezign.tripod.com/webhelp.htm

...you might want to take a second look at the Outline applet by David Griffiths? In no way would this be a replacement for what Leif can do. I'd much rather use your plugin, Leif, than to fumble with this. But thought since we're talking about passing from browsers to Nbk, javascripts and Trees, this might be yet another way to do it.

David gave me permission to redistribute it, so we might as well make good use of it. I think it's a pretty slick applet. He has newer versions of this applet that are more advanced but I still like this older one because it's all self-contained and eaiser to use. If you're into it, look in the doc for his website and pick up the newer one if you want to have more control over the look. (Of course, there's a forest of tree menu's out there - but some of them can get rather... "involved")  



<hr>


I was curious if you are able to still pass these parameters with Java Applets. I am not to familiar with them because they were always to slow for web pages so i never used them... But when loading from a cd or hard drive they probably work fine....

Just wondered if you actually got the treeview to work or just mentioned it as an idea. Either way I guess I have to try or i will never know!!!!

Anyways I emailed Dave about the MouseExit error on the ListBox and also sent him a sample of what you and Jay figured out..

From Email to Dave
======
Here is another thing that I was asking about on the Neodezign forum and Jim and Jay came up with a solution where you can call Neobook Actions from a Web
Page...

That's an interesting idea! I hadn't thought about calling NeoBook actions from a web page. I'll give it some thought. I don't think there's time to add it to the current update, but I'll definitely keep it in mind for a
future version.

Sincerely,
Dave Riley
==============

Who knows but it's exciting..

Polaris

<hr>


Hello,
As this think is getting exiting more and more ...

Now that we are talking about Parameters ..
Let me show you a simple way to pass Unlimited Paramters.....

here is an example ...
It Took on line of Code heeeeeee....

Note the Two New Scirpts in the Code :

StrParse "[url]" "," "[jay[X]]" "[num]" Which was added to WebBrowser1 Actions ..... get it here: www.1800mns.com/iles/webp.zip have fun. Jay.....


<hr>


The Link is Broke here is the Good one:

http://www.1800mns.com/files/webp.zip


later.

Jay


<hr>



Yep, demo in the PUBz 4 area...

Outline Tree Menu
http://neodezign.tripod.com/nbk4/pubz4.htm

<hr>


Ha! Delimited strings...  My specialty!

*Now* it's getting interesting (brb)


<hr>


You can clean up your output with this...


StrParse "[url]" "," "[jay[X]]" "[num]"

Loop "1" "[num]" "[AZ]"
StrReplace "[jay[AZ]]" "%20" " " "[jay[AZ]]"
EndLoop



<hr>

Web Base...

http://neodezign.tripod.com/nbk4/pubz4.htm


<hr>

Didn't ever use it before this. Actually is great because you could store unlimited variables and its clean. Keep your thinking caps on because you are on a rolll!!!!  

Jim tried out the TreeMenu Applet and it works good and pass the parameter's works just as easy.. This is why i never used java applets because that ugly grey box that appears while they are loading. Some offer a alternate background color and wonder if you are familiar with it and now a way to turn it white so you don't see the flicker while it loads..

Maybe I will go visit Java Botique and see what applets are floating around..


Polaris

(Edited by Jim Brammer at 7:58 pm on Feb. 7, 2002)
Jim Brammer
 

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest