Continue
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Schneider Electric
Community
Community
Notifications
close
  • Categories
  • My Subscriptions
  • Forums
  • Knowledge Center
  • Blogs
  • Ideas
  • Events
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register

Contact Support

Close

Ask our Experts

Have a question related to our products, solutions or services? Get quick support on community Forums

Email Us

For Community platform-related support, please email us

New Community Ranking System
Our Community ranking system has recently been updated. You may notice changes in user rankings and receive system messages or notifications. If you have questions about how the new ranking works, please refer to the announcement post for more details (click here).

Writing Scripts using JavaScript

Geo SCADA Knowledge Base

Access vast amounts of technical know-how and pro tips from our community of Geo SCADA experts.

Search in

Improve your search experience:

  • Exact phrase → Use quotes " " (e.g., "error 404")
  • Wildcard → Use * for partial words (e.g., build*, *tion)
  • AND / OR → Combine keywords (e.g., login AND error, login OR sign‑in)
  • Keep it short → Use 2–3 relevant words , not full sentences
  • Filters → Narrow results by section (Knowledge Base, Users, Products)
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Knowledge Center
  • Geo SCADA Knowledge Base
  • Writing Scripts using JavaScript
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Labels
Top Labels
  • Alphabetical
  • database 32
  • Web Server and Client 31
  • WebX 19
  • Request Form 18
  • Lists, Events & Alarms 16
  • ViewX 15
  • Application Programming 12
  • Setup 12
  • Telemetry 8
  • Events & Alarms 7
  • Lists 7
  • Mimic Graphics 7
  • Downloads 6
  • Security 5
  • Geo SCADA Expert 5
  • SCADA 5
  • IoT 5
  • Support 5
  • Drivers and Communications 4
  • DNP 3 3
  • IEC 61131-3 Logic 3
  • 2025 3
  • Geo Scada 2
  • Virtual ViewX 2
  • Python 2
  • Trends and Historian 2
  • Known Issues 1
  • Archive 1
  • Privacy Policy 1
  • OPC-UA 1
  • Updates 1
  • PI 1
  • Python API 1
  • Code 1
  • Driver Kit 1
  • Mobile 1
  • Maps and GIS 1
  • Releases 1
  • Templates and Instances 1
  • Architectures 1
  • Tools & Resources 1
  • AVEVA 1
  • ClearSCADA 1
  • Historian 1
  • Web 1
  • Upgrade 1
  • Previous
  • 1 of 5
  • Next
Latest Blog Posts
  • Using Script to set Value Map content
  • Writing Scripts using JavaScript
  • Adjustments for VBScript in Geo SCADA 2025 R2
  • Geo SCADA 2025 R2 Operating System Support
  • Geo SCADA 2025 R2 Known Issues

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
sbeadle
sbeadle Champion
Champion
‎2026-10-16 07:38 AM
0 Likes
0
167
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2026-10-16 07:38 AM

Writing Scripts using JavaScript

Originally published on Geo SCADA Knowledge Base by sbeadle | October 16, 2026 04:38 PM

Home   Back

This is an evolving article and new items will be added periodically

 

Geo SCADA Expert 2025 R2 adds support for scripts that are written in the JavaScript V8 scripting language. V8 is Google's open-source high-performance JavaScript engine. It is used in Chrome, Edge, and other major browsers.

 

This page is a guide to writing mimic and global script code in the JavaScript language now available from Geo SCADA 2025 R2 (88) and up.

 

This guide notes some key differences with script written in VBScript and includes conversion notes.

 

VBScript to JavaScript Conversion Notes

When converting scripts, note that:

  • A single mimic must reference scripts and script libraries only written in the same language. Embedded mimic scripts can be in a different language, but in that case the 'Execute script on parent' feature cannot be used.
  • If multiple mimics share the same script libraries, you will need to unlink and relink individual mimics to refer to new script libraries in your new language.
  • Older ViewX clients (2025 Release and older) cannot run JavaScript, so be careful to upgrade all clients before updating scripts to JavaScript.
  • The Microsoft COM Automation capability using the CreateObject function is not yet available in scripts that are written in the JavaScript (V8) scripting language.

 

New Window API Methods for JavaScript V8

The MsgBox function in VBScript is not available in JavaScript. For this language we have provided Alert, Confirm and Prompt methods to enable simple user interaction. Examples of their use are:

 

let result;
result = Window.Confirm("Press a button!\nEither OK or Cancel.")
if (result == true)
{
    Window.Alert("You clicked ok");
}
 
let name;
name = Window.Prompt("Please enter your name", "name")
if (name != null)
{
    Window.Alert("You entered: " + name);
}
else
{
    Window.Alert("You clicked Cancel");
}

 

For more information, see the ‘Window Functions’ branch of topics in the Scripting Guide in the online help.

An alternative to using these functions to replace MsgBox is to use the Form API features. There is an example of this in the default installed configuration. See in the group Symbol Library.~Config.Script Libraries where a library is used to provide similar facilities to MsgBox. The script library is called MsgBox for V8 and a test mimic MsgBox for V8 Test.

 

LocalTimeToUTC and UTCToLocalTime

The LocalTimeToUTC and UTCToLocalTime Global functions are not supported by scripts that are written in the JavaScript (V8) scripting language.

This is because the JavaScript language already includes adequate functionality for Date objects with local and UTC time methods.

See this external web site for reference information:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

 

Translation Notes

When translating either JScript or VBScript code to JavaScript V8, please note the following items:

  • JavaScript V8 does not support the CreateObject or ActiveXObject features of JScript or VBScript. A future substitute in later releases will be available for the general types of capability these provide.
  • Form layouts (the X, Y and sizing of items) use different units. These are 'pixel' units and not 'text' units. Consequently, the positions and dimensions of Form.Add<item> code will need to be changed.
  • Refer to the message box, Clipboard and time notes in the sections above.
  • Refer to the JScript section above, as there are similar constraints on case sensitivity and type conversions.

 

 

 

Home   Back

 

Author

Biography

sbeadle

Link copied. Please paste this link to share this article on your social media post.

  • Back to Blog
  • Newer Article
  • Older Article
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support

    Ask our Experts

    Have a question related to our products, solutions or services? Get quick support on community Forums

    Email Us

    For Community platform-related support, please email us

Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2026 Schneider Electric

Welcome!

Welcome to your new personalized space.

of

Explore