Call Home button via scripting - Beta 2b

Is it possible to place a HTML button on a page and call the “Home” button via the “Execute an HEScript Function”? PHP and/or JavaScript.

I have looked at “HTML Executable JavaScript API” in help, but my old head is not getting it OR maybe not possible?

Understand that I could simply place a link to the internal home page but need to know how to call via HEScript.

I really need to brush up on HEScript’ing and learn more :slight_smile: Searched forum but not finding what I need.

In the documentation (latest beta), you have a topic called:
“How to call a javascript function from HEScript (toolbar, menubar)?”
This is probably what you are looking for.
The doc is not available online yet, so start HTML Executable Help and search for executehtmlscript

Yes, I have read and reread this. But my issue is: I do not understand how to call the toolbar home function from a standard HTML button on HTML page. Seems easy enough but my old head is not grasping.

Basically, you want the browser to go to the homepage of the app?

Yes, that is correct. Button on a HTML page that uses hescript to call home.

Simple to make a HTML link to home page, but users are on the school network and no way to get them back to home page. Hoping that can call home button via scripting.

Create an HEScript procedure in UserMain:

procedure GoHome;
begin
GoToPage(GetString("SPubHomepage"), "");
end;

And then you can invoke GoHome with JavaScript or better simple HTML link:
<a href="hescript://UserMain.GoHome">Go to homepage</a>

I had tried this, but it sends user to the “Web Homepage” listed in the default settings (i.e. https://example.com). I need the link to go to the home page listed in file manager.

My bad, it should be the real homepage and not the web homepage :slight_smile:

procedure GoHome;
begin
GoToPage(GetGlobalVar("HomePage","fnf.htm"), "");
end;

Perfect! Thank you.

I had some of the code right but did not have the fnf.htm. Never saw doc reference to fnf.htm but might have missed it.

1 Like

The “fnf.htm” is just a dummy filename in case of the homepage does not exist, it will show this one and since it does not exist too, it will show the classical 404 error page.

1 Like