Global - Overview

The Global functions can be called without a reference to an object in a publication. In Opus Pro, the publication and the page are Global objects and the functions here are properties of those objects.

In addition to these functions, there are also Global String functions that perform many simple string and conversion operations.

Hierarchy:

Only the specific functions listed under the Functions: heading below can be used with Global objects:

Class Hierarchy:

Global

Hierarchy of objects in Opus

Functions:

ChangeDisplayMode

Change the user’s Display Mode (i.e. screen resolution) when running the publication

CopyFile

Copy a file to a new location of the user’s machine

CountLines

Count the number of lines in a text object or string/variable

CountWords

Count the number of words in a text object or string/variable

CreateCDPlayer

Create a new CD player Object

Debug.trace

Debugging tool that uses the Script Console

Debug.tracePane

Debugging tool that creates a new pane in the Script Console

DeleteFile

Delete a file from the user’s machine

DeleteRegistryValue

Delete a name/value pair for the system registry

ExitPublication

Exit the publication, via an Exit page (if any)

FileExists

Test if a file exists in a given location

fork

Allows lines of code to be executed simultaneously

GetINIFileData

Return the value of a specified key in a specified section of an INI file

GetINISectionData

Return the contents of a section of an INI file as a string

GetJoystickState

Return the current state of the first system joystick

GetKeyState

Return the current atate of the Num Lock, Caps Lock or Scroll Lock keys.

GetLastPage

Get the last page in the publication

GetLocale

Get current user locale (language and country information)

GetPage

Get a page by name

GetPageDownloadPercent

Get the percentage complete of the page downloaded

GetPageDownloadPosition

Get the position of the page downloaded

GetPageDownloadTotal

Get the total size of the page downloaded

GetType

Get the object’s Object Type e.g. button, image etc.

GotoBackwardPage

Go to the previous page in the publication

GotoCurrentPage

Go to the current page in the page history

GotoForwardPage

Go to the next page in the publication

GotoNextPage

Go to the next page in the page history

GotoNextRandomPage

Go to a random page within the chapter without repeating

GotoPage

Go to a given page

GotoPreviousPage

Go to the previous page in the page history

GotoRandomPage

Go to a random page within the chapter

HtmlHelp

Open a Compile HTML help file.

InternetGetData

Gets information from a remote server

InternetPostData

Post information to a remote server

IsKeyPressed

Test if a specific key is being pressed

IsMousePressed

Test if a specified special key is being pressed

IsPreview

Test it the current player is the Opus edior preview

LaunchFile

Open an external file

LaunchSearch

Open the Search dialog box

LaunchURL

Open a URL

OpenSearch

Returns a search object containing the publication search words

PlayCDTrack

Play a track from a CD

PlaySystemSound

Play a system sound from the users computer

PrintFile

Print the specified file

PrintObject

Print the specified object

PrintPage

Print the specified page or page Object

ReadRegistryKey

Return the value of a specified key in the system registry

ReallyExitPublication

Exit the publication immediately

ReportClose

Close the open log file

ReportGetFilename

Get the filename of the current log file

ReportSetFilename

Set the output file for logging actions

ReportWriteString

Write a string to the current log file

RGB

Return a number indicating a RGB colour value

SendEmail

Send an email

SetINIFileData

Set the value of a specified key in a specified section of an INI file

SetKeyState

Change the state of the Num Lock, Caps Lock or Scroll Lock keys.

WinHelp

Open a standard Windows help file

WriteRegistryValue

Write a name/value pair to the system registry