There are a number of important variables that are created and updated automatically by VisualNEO for Windows. These variables contain information about the status of your publication, the reader’s computer, the current date and time, etc. These may be inserted wherever normal variables are accepted.


Read-Only Variables


The first group of global variables are Read-Only, meaning that they can be examined and displayed, but not modified, using the SetVar or other Action commands.


App Properties

[CommandLine]

Command line parameters passed to the publication. Multiple parameters are separated with carriage returns [#13]. The first parameter is always the name of the publication exe.

[PubAuthor]

The publication’s author as specified in App Properties.

[PubColors]

The publications native color resolution as specified in App Properties.

[PubVersion]

The publication's version number as specified in App Properties > Version Info.

[PubLeft]

[PubTop]

The position of the upper left corner of the interior of the publication window (the client area) in screen coordinates. These values can be added to the coordinates of an object to determine its absolute position relative to the entire screen.


Page Properties

[PageTitle]

The title of the current page.

[PageNumber]

The number of the current page. See also [PageNumberOffset].

[P]

Same as [PageNumber].

[PageNumberLeft]

[PageNumberRight]

These variables can be used to simulate left and right page numbers on publications that are designed to appear as if each screen is composed of two facing pages. See also [PageNumberOffset].

[PageCount]

The total number of pages in the publication, excluding the master page.

      

Date/Time

[Time]

The current time (H:M:S AM/PM).

[Time24]

The current time in 24-hour format.

[Hour]

The current hour.

[Minute]

The current minute.

[Second]

The current second.

[DateShort]

The current date in Windows’ short format (10/22/15).

[DateLong]

The current date in Windows’ long format (October 22, 2015).

[Month]

The current month in text form (October).

[MonthNum]

The current month in number form (10).

[Day]

The current day of the week in text form (Monday).

[DayNum]

The current day of the months in number form (1-31).

[Year]

The current year (2015).


Windows/Hardware

[CDRomDrive]

Drive letter of the first CD-ROM drive or “error” if none.

[HDSerialNum]

Returns the serial number for the system's C: drive.

[NetworkDrive]

Drive letter of the first network drive or “error” if none.

[ScreenColors]

The number of colors supported by the current Windows video mode.

[ScreenHeight]

The height the entire Windows screen in pixels.

[ScreenWidth]

The width of the entire Windows screen in pixels.

[SystemLanguage]

Returns the active system locale (language). For example: “English (United States)”

[SystemLanguageExt]

Returns the standard three-letter extension for the active system locale (language). For example: “ENU” for English (United States).

[UserName]

The name of the currently logged in user (if a network is installed).

[WindowsPlatform]

The current Windows platform installed (Windows 95, 98, ME = 1, Windows NT, 2000, XP and higher = 2).

[WindowsVer]

The major and minor Windows version number (4.0 for Windows 95, 5.1 for Windows XP, 6.0 for Vista, 6.1 for Windows 7, 6.2 for Windows 8, 6.3 for Windows 8.1, 10 for Windows 10).

[WindowsVerName]

The published name of the installed version of Windows. For example: “Windows 10 Home”.


Folders

[MyDocuments]

The location of the current user’s “My Documents” folder.

[ProgramFiles]

The locations of the system’s “Program Files” folder. This folder’s name may be different depending on the system’s default language.

[PubDir]

The folder where the publication EXE resides.

[SystemDir]

The location of the Windows system directory (usually c:\windows\system).

[TempDir]

The location of the Windows temp folder.

[WindowsDir]

The folder where Windows itself is installed (usually c:\windows).


Messages/Errors

[MCIResult]

Used by the MCICommand Action to report errors. If MCICommand is successful, [MCIResult] will contain a 0 (zero), otherwise [MCIResult] will contain an error number.

[MCIResponse]

Used by the MCICommand Action to store information return by the device. The contents of this variable (if any) depends entirely on the MCI command string used.

[LastError]

Disabling the Display Error Messages option on the Misc. page of the App Properties screen allows experienced VisualNEO for Windows authors to trap and respond to errors programmatically rather than having VisualNEO for Windows display the error in a dialog box. When this option is off, all error messages are placed in the [LastError] variable. You can use this variable in your Action scripts to determine when an error occurs and respond appropriately. For example:

FileWrite "parts.dat" "Append" "[PartNum]"
If "[LastError]" ">" ""
   AlertBox "Error" "Unable to Parts file."
EndIf

       

Advanced

[Embedded]

Special embedded file variable indicates that the file name that follows has been embedded inside exe. See Embedded Files.

[FocusedObject]

The name of the object that has the input focus.


Note: This variable is primarily intended to be used in scripts to identify which object is active. It is not a "live" variable and will not automatically update the screen whenever an object is clicked.

[VisualNEO for WindowsVersion]

Returns the VisualNEO for Windows version number. The variable will contain the major and minor version number followed by a period and the build number which corresponds to the version letter (if any). For example, version 5.0.0 would be “500.0” and version 5.1.1a would be “511.1”. (Since this variable was not available prior to version 4.1.1d, [VisualNEO for WindowsVersion] will be empty for previous versions of VisualNEO for Windows.)

[NBMode]

Contains “D” if publication is running from VisualNEO for Windows's design mode or “R” if running from compiled/runtime mode.

[NBType]

Returns type of compiled pub - A = application, S = screen saver, T = tray application, W = web plug-in

[Self]

The name of the object that executed the currently running Action script. For scripts not executed by objects (such as page enter/exit), [Self] will be empty.

[WinHandle]

The handle (HWND) of the publication’s windows (Generally of use only to plug-in authors).

[HyperlinkClickedText]

This variable contains the text of the most recently clicked hyperlink. This applies to the Article, Linked-Article and Simple Text objects.

[AppID.ProcessID]

[AppID.ProcessHandle]

[AppID.WinHandle]

These variables contain technical information about applications launched with the Run or RunInRectagle actions. The first part of the these variables are based on the Run action's unique identification number (AppID) variable. For example, if the AppID variable is [NotePad] then the corresponding ProcessID variable would be [NotePad.ProcessID]. These variables will generally only be of interest to plug-in developers.

[AppID.ExitCode]

This variable will contain the exit code of an application launched with the Run or RunInRectagle actions. Some utilities use exit codes for returning information or to indicate that an error has occurred. For most Windows applications, however, the exit code will be zero.

[Object.WinHandle]

Use this variable to access the handle (HWND) of the window created by the CustomWindow action. The first part of this variable is based on the name of object used to create the window. For example, a custom window created from an object named Container1 will result in a variable called [Container1.WinHandle]. (Generally of use only to plug-in authors).



Read-Write Variables

The global variables below are Read-Write meaning they can be read from as well as written to:


App Properties

[AppTitle]

The title of the application which appears in the tray icon and the Windows Task Manager. Initially, [AppTitle] and [PubTitle] are the same.

[PubTitle]

The caption in the title bar of the publication window.

[PubWidth]

The width of the interior of the publication window (the client area).

[PubHeight]

The height of the interior of the publication window (the client area).

[PageChangeName]

This variable can be used to abort or redirect a page change by modifying it from within the App Properties > Page Change Action. Upon entering the Page Change Action, this variable will contain the name of the page the reader wishes to navigate to. You can abort the page change by clearing the variable like this:

SetVar "[PageChangeName]" ""

The page change can be redirected by setting the variable to the name of another page:

SetVar "[PageChangeName]" "Error Page"


Setting this variable anywhere other than in the Page Change Action has no effect.

[ShutdownStatus]

This variable can be used to abort a publication exit by setting it to “False” from within the App Properties > Shutdown Action. For example:

SetVar "[ShutdownStatus]" "False"

Setting this variable anywhere other than in the Shutdown Action has no effect.

[ShutdownSource]

In addition to [ShutdownStatus] above, you can also examine the global [ShutdownSource] variable from within the App Properties > Shutdown Action to determine what caused the publication to close. [ShutdownSource] may contain one of the following:


VisualNEO for Windows

The shutdown request was triggered by VisualNEO for Windows's Exit action.

Windows

The shutdown request originated with Windows. There are several Windows functions that could trigger a shutdown request, including: selecting "Turn off computer" from the Start Menu; the Task Manager's End Task command; or manually closing the application's icon from the System Tray. You should not normally refuse to close the publication when the requested to by Windows.

CloseButton

The user clicked on the publication window's close button, selected close from the system menu, or pressed Alt+F4.


For example, to minimize the publication instead of closing it when the source of the shutdown is the close button, do the following:


If "[ShutdownSource]" "=" "CloseButton"

  SetVar "[ShutdownStatus]" "False"

  SetVar "[WindowState]" "Minimized"

EndIf

[StartInSystemTray]

Normally, when a compiled system tray applications is launched it will automatically appear as an icon in the tray. If you would prefer to have your tray application open in a window instead, you can place the following code in the App Properties Startup Action:

SetVar "[StartInSystemTray]" "False"

Once open, minimizing the window will send it to the system tray. Remove this code to start the publication normally as an icon in the system tray.

[WindowLeft]

The screen Y location of the upper left of the publication window.

[WindowTop]

The screen X location of the upper left of the publication window.

[WindowWidth]

The width of the publication window including the border and scroll bars (if any).

[WindowHeight]

The height of the publication window including the title bar, border and scroll bars (if any).

[WindowState]

The display state of the publication window (Normal, Minimized or Maximized).

[WindowOrder]

The publication window’s order as set in App Properties (Normal, OnTop or OnBottom).

[WSHTimeOut]

Set this variable to modify the timeout value (in seconds) used when executing VBScript and JScript functions. Use "-1" to disable the timeout feature. (WSH stands for Windows Scripting Host.)


Page Properties

[PageNumberOffset]

Set this variable to offset page numbering sequence used to calculate the [PageNumber], [PageNumberLeft] and [PageNumberRight] variables. The offset will be subtracted from the page number. This is for display purposes only. The physical page number is not affected.

Drag & Drop

[DropAccept]

[DropX]

[DropY]

[DropTarget]

These variables can be used to influence how drag and drop operations are performed. See Polygon/Hotspot Tool for information about using these variables.


Folders

[CurrentDir]

Contains the current active folder. Use in conjunction with the Run Action to specify an application's working directory. This will become the active directory when the application is launched. For example:

SetVar "[CurrentDir]" "c:\windows"
Run "C:\MyPrograms\MyApp.exe" "" "Normal"

To disable the Run action's use of the working directory, simply set [CurrentDir] to null. For example:

SetVar "[CurrentDir]" ""


Windows

[Clipboard]

The contents of the Windows Clipboard (text format only). You can place text onto the Windows Clipboard using the SetVar Action. For example:

SetVar "[Clipboard]" "Place this on the clipboard."

[DecimalSymbol]

The character stored in this variable is used to separate the integer part from the fractional part of a number. The default value is determined by the settings in the Windows Control Panel. Changing this variable only affects the current publication. It has no effect on Windows or other running applications. Plug-ins are also not affected unless they have been specifically designed to check for changes to this variable.


Mail/HTTP

[MailServer]

The name of the user’s SMTP email server. Used for sending messages via the SendMail Action. If left blank, readers must enter the server address manually before sending email since it can be different on each computer system.

The [MailServer] variable can be used to manually set the name of the reader's SMTP email server. By default, VisualNEO for Windows will attempt to detect the name of the server before sending an email message, and then ask the reader to confirm if the detected server name is correct. Setting [MailServer] variable to "Detect" prior to executing SendMail will skip the user confirmation if VisualNEO for Windows was able to detect the server name. For example:

SetVar "[MailServer]" "Detect"
SendMail...

However, if VisualNEO for Windows is unable to detect the server name, the user will still be prompted to enter it manually.

[MailPort]

If your mail server requires that you use a port other than 25 (the default), you can use this variable to specify a port number. For example:


SetVar "[MailPort]" "80"

SendMail...

[MailUserID]

[MailUserPassword]

Use these two variables to specify the user ID and password when using the SendMail Action with servers that require authentication. For example:

SetVar "[MailUserID]" "nancy123"
SetVar "[MailUserPassword]" "applesauce"
SendMail...

[HTTPUserID]

[HTTPUserPassword]

Use these two variables to specify the user ID and password when using any of the HTTP Actions with protected servers or folders. For example:

SetVar "[HTTPUserID]" "nancy123"
SetVar "[HTTPUserPassword]" "applesauce"
DownloadFile...

[HTTPTimeOut]

Use this variable to specify the number of milliseconds VisualNEO for Windows should wait for an HTTP action to return before giving up. For example, to set the timeout to 400 milliseconds:


SetVar "[HTTPTimeOut]" "400"

InternetGet...


To restore the default setting (wait forever), set [HTTPTimeOut] to null like this:


SetVar "[HTTPTimeOut]" ""

[HTTPPort]

If your HTTP server requires that you use a port other than 80 (the default), you can use this variable to specify a port number. For example:


SetVar "[HTTPPort]" "1000"

InternetGet...

[HTTPAgent]

Advanced. Use this variable to specify the name of the application making the HTTP request. This name is used as the user agent in the HTTP protocol. The default value for the user agent is the publication title.

[HTTPReferrer]

Advanced. Use this variable to specify a URL to be passed to the server to identify the source (referrer) of the HTTP request. By default, the referrer is blank.

[DownloadProgress]

This variable contains a number (0-100) that represents the progress of the current HTTP Action. Long HTTP Actions can be aborted by changing the contents of this variable to “Cancel”. For example:

SetVar "[DownloadProgress]" "Cancel"