API from JavaScript

Everything API- and SmartSEM-related that won't fit in the other categories. Share general aspects of API programming and discuss SmartSEM.
Post Reply
user-3513
Posts: 2
Joined: Thu Jan 01, 1970 1:00 am

API from JavaScript

Post by user-3513 »

Carl Zeiss Microscopy 10 wrote:The API can as well be accessed from various scripting languages such as VBScript and JavaScript.
I strongly advise against any mentioning of the Javascript in any API related documents because well it doesn`t work. As simple as that. True one can call "Initialise" method without throwing any error but that`s about it. There is no way to use the most important ".Set" and ".Get" methods in Jscript.
Doing something like this to get the Magnification from the SEM column won`t give you the correct value neither in A nor in B.

Code: Select all

var A,B;
B=CZEMApi.Get("AP_MAG", A);
So in the end one is left only with the VBScript for doing some basic automation to run say under Windows host script environment.
user-2734
Posts: 4
Joined: Thu Jan 01, 1970 1:00 am

Post by user-2734 »

masta wrote:I strongly advise against any mentioning of the Javascript in any API related documents because well it doesn`t work....
My JavaScript experience is limited to programming it into HTML (typically for activating button click functionality) and running is while the web browser displays the page. Is this what you are trying to do, running the Remote API ActiveX control from a web browser?

As a general note, the API was developed in its first incarnation some 15 years ago when ActiveX was the coolest thing on the planet according to Microsoft. Now running an ActiveX control from a web browser is considered on par with some evil hacking attempt. So different browsers will treat this in different ways, but certainly try to prevent execution in some ways.

You are the first person to try using the API from javaScript since 10 years. Perhaps you can explain what you tried to do exactly, preferably forward your code to my email. Otherwise I will just remove the mention of JavaScript.

Best regards, Hidde Wallaart
Post Reply