In Detail:

Opus Script Reference

reference list of OpusScript functions

A complete list of all functions available in OpusScript. Not all functions are supported in all export formats - see program Help for details.

 

General Functions

FunctionCategory Description
AddPoint FrameAdd a point to the current contour in the frame
Back Browsers Goes back one page in the browser history
Backward MultiFrames Go back one frame
bool Global Convert a value to a Boolean
CallFn External DLL Call a function within a DLL
CaptureMouse Graphics Capture the mouse input
ChangeDisplayMode Global Change the user's screen resolution
charAt String Get the character at the specified position in the string
charCodeAt String Get the character code at the specified position in the string
CharFromPoint TextGet the character at a given position
ClearBookmark Pages Clear a Bookmark for the current page
ClearDraw Frame Remove all script drawing elements from the frame
CloneObject Graphics Clone an object
Close File Close an opened file
Close Views Close the view
contains Global Test if one string contains another string
Continue Clock Continue a paused clock Object
Continue Slideshow Continue a Slideshow
CopyFile Global Copy a file to a new location of the user's machine
CopyToClipboard Graphics Copy an object to the Windows clipboard
CopyToClipboard Pages Copy the page to the Windows clipboard
CreateCDPlayer Global Create a new CD player Object
CreateCDPlayer Sound Create a CD player Object
CreateClock Clock Creates a new clock Object
CreateHypertext TextCreate a hypertext link and action for a selection
Debug.trace Global Debugging tool that uses the Script Console
Debug.tracePane Global Debugging tool that creates a new pane in the Script Console
DeleteFile Global Delete a file from the user's machine
DeleteRegistryValue Global Delete a value from the system registry
DestroyClonedObject Graphics Destroy a cloned object
DrawEllipse Frame Draw an ellipse in the frame
DrawLine Frame Draw a line between two points in the frame
DrawRectangle Frame Draw a rectangle in the frame
DrawRegPoly Frame Draw a regular polygon (eg triangle or octagon) in the frame
DrawRoundRectangle Frame Draw a round cornered rectangle in the frame
DrawStar Frame Draw a star in the frame
Enable Graphics Enable or disable this object
EndOfFile File Check for the end of file marker in the specified file
ExitPublication Global Exit the publication, via an Exit page (if any)
Fade Graphics Fade an object by an amount
FileExists Global Test if a file exists in a given location
FindChild Basic Objects Finds the child of this object with a particular name
FindDescendent Basic Objects Finds the descendent of this object with a particular name
FindText TextFind a string of text in a Text object
FindTextInSelection TextFind a string of text in a selection
FollowPath Graphics Make an object follow an animation path
fork Global Allows lines of code to be executed simultaneously
format Global Format a number as a string
Forward Browsers Goes forward one page in the browser history
Forward MultiFrames Go forward one frame
GetAppearance Graphics Get appearance information for Object State of specified object
GetBookmarkPage Pages Get Bookmark page by its index number
GetChild Basic Objects Gets a child of this object by index
GetClock Clock Returns a specified clock Object
GetDisplayData Graphics Get display information related to an object e.g. scale and skew
GetFirstBookmark Pages Get the first Bookmark page
GetFirstChild Basic Objects Gets the first child of this object
GetFirstHypertext TextGet the first hypertext link in a specified text object
GetFirstKeyword Search Gets first keyword in search list
GetFirstPage Search Gets first page to search on
GetFirstView Views Get the first view open
GetHeight Graphics Get the height of the object
GetHours Clock Returns number of hours for a clock Object
GetINIFileData Global Return the value of a specified key in a section of an INI file
GetINISectionData Global Return the contents of a section of an INI file
GetJoystickState Global Get the current joystick state
GetLastPage Global Get the last page in the publication
GetLastPage Publications Get the name of the last page in the publication
GetLayer Graphics Get the layer that the object is on
GetLength Video Get the length of the video in seconds
GetLineCount TextGet the number of lines
GetLocale Global Get current user locale (language and country information)
GetMinutes Clock Returns number of minutes for a clock Object
GetMousePosition Pages Get the x and y coordinates of the current mouse position
GetName Basic Objects Gets the name of the object
GetNextBookmark Pages Get the next Bookmark page
GetNextChild Basic Objects Gets the child of this object that follows another
GetNextHypertext TextGet the next hypertext link in a specified text object
GetNextKeyword Search Gets next keyword in search list
GetNextPage Pages Get the next page in the publication
GetNextPage Search Gets next page to search on
GetNextView Views Get the next view
GetNumberChildren Basic Objects Gets the number of children of this object
GetNumberHypertext TextGet the total number of links in a specified text object
GetNumberViews Views Get the number of views open
GetObjectDimensions Graphics Get the position and size of an object
GetPage Global Get a page by name
GetPage Publications Get a page by name
GetPage Views Get the page currently displayed in the view
GetPageDownloadPercent Global Get the percentage complete of the page downloaded
GetPageDownloadPosition Global Get the position of the page downloaded
GetPageDownloadTotal Global Get the total size of the page downloaded
GetPageNumber Pages Return page number of current page open in the publication
GetParagraphCount TextGet the number of paragraphs in a Text object
GetParent Basic Objects Gets the parent of this object
GetPersistentObject Graphics Get object for storing information that will persist when page not visible
GetPosition Graphics Get the x and y coordinate of the objects position
GetPosition Graphics Get the x and y coordinate of an animation path's length
GetPosition Sound Get the current position in seconds for a sound file
GetPosition Video Get the current position of a video in seconds
GetPositionFromPercent Graphics Get the x and y coordinate of an animation path as percent along the path
GetPreviousPage Pages Get the previous page in the publication
GetPublication Pages Get the name of the current publication
GetScrollInfo Graphics Get the scroll position, scroll size and scrollbar
GetSeconds Clock Returns number of seconds for a clock Object
GetSelection TextGets the position of the selected characters
GetSelectionParagraphStyle TextGet the paragraph style of selected text
GetSelectionStyle TextGet the formatting style of selected text
GetSelectionText TextGets the selected text as a string
GetSlide Slideshow Get the slide currently visible
GetSlideCount Slideshow Count the number of slides in a slideshow
GetState Buttons Returns the current state of a push button
GetText TextGet the text used for a hyperlink as a string
GetTextLength TextGet the number of characters
GetTotalLength Graphics Get the total length of an animation path
GetType Global Get the object’s Object Type e.g. button, image etc.
GetType Views Get the View Type
GetUniqueObjectID Basic Objects Gets a string that is unique to this object
GetViewAt Views Get the view at a specified index position
GetVolume Sound Get the volume level of a specified device
GetVolume Sound Get the volume level of a specified sound Object
GetWidth Graphics Get the width of the object
GetWordCount TextGet the number of words
GetXPosition Graphics Get the x coordinate of the objects position
GetYPosition Graphics Get the y coordinate of the objects position
Go Video Set the first frame of a video
GotoAndPlay - Tween Graphics Go to a particular frame of a tween and start playing
GotoAndStop - Tween Graphics Go to a particular frame of a tween and stop playing
GotoBackwardPage Global Go to the previous page in the publication
GotoBookmark Pages Go to a specific Bookmark
GotoCurrentPage Global Go to current page in publication
GotoFirstLine File Goes to first line of an opened file
GotoForwardPage Global Go to the next page in the publication
GotoFrame - Tween Graphics Go to a specific frame in a Tween.
GotoNextLine File Goes to next line of an opened file
GotoNextPage Global Go to the next page in the page history
GotoNextRandomPage Global Go to a random page within the chapter without repeating
GotoPage Global Go to a given page
GotoPreviousPage Global Go to the previous page in the page history
GotoRandomPage Global Go to a random page within the chapter
GotoSlide Slideshow Go to a specific slide
Hide Graphics Hide this object
Home Browsers Goes to the Home page of the specified browser Object
indexOf String Return the position within the String object of the substring
integer Global Convert a value to an integer
InternetGetData Global Gets information from a remote server
InternetPostData Global Post information to a remote server
IsAutonarratePlaying Text Check if an autonarrate is currently playing
IsEnabled Graphics Test if this object is enabled
IsKeyPressed Global Test if a specific key is being pressed
IsMousePressed Global Test if a specified special key is being pressed
IsObjectIntersecting Graphics Test if this object is intersecting another
IsPlaying Slideshow Check if a specified Slideshow is playing
IsPlaying Video Check if a specified video is playing
IsShowing Graphics Test if this object is showing
lastIndexOf String :Get the position in a string of the last match of a substring
LaunchFile Global Open an external file
LaunchSearch Global Open the Search dialog box
LaunchURL Global Open a URL
left Global Get the left end of a string
length Global Get the length of a string
length String The length of the string
LineFromChar TextGet the line index of a character position
LineIndex TextGet the character index of the first character in a line
LineLength TextGet the number of characters in a line
LoadDLL External DLL Load a DLL so functions can be accessed
MAX_VALUE Number The largest number that can be represented in OpusScript
mid Global Get part of the middle of a string
MIN_VALUE Number The smallest number that can be represented in OpusScript
Move Graphics Move the object by its x and y coordinates
MoveX Graphics Move the object by its x coordinate
MoveY Graphics Move the object by its y coordinate
NaN Number Returns a value that is "not a number"
Navigate Browsers Open a specified URL in specified browser Object
NEGATIVE_INFINITY Number A value representing negative infinity
number Global Convert a value to a number
OpenFile File Opens a file and returns a new file Object
OpenSearch Global Returns object containing the publication search words
OpenSound Sound Open a sound file but don't play it
ParagraphIndex TextReturns the index number of the paragraph in a Text object
ParagraphLength TextReturns the number of characters in a paragraph
Pause Clock Pause a clock Object
Pause Slideshow Pause a Slideshow
Play -Slideshow Slideshow Play a Slideshow
Play-Sound Sound Play a sound file
Play-Video Video Play a specified video
Play - Tween Tween Play a Tween Animation
PlayAutonarrate TextBegin the autonarration on this text
PlayCDTrack Global Play a track from a CD
PlaySound Sound Play a sound file
PlaySystemSound Global Play a system sound from the users computer
PointFromChar TextGet the position of a character
POSITIVE_INFINITY Number A value representing positive infinity
Print Browsers Print the contents of a Browser object
PrintFile Global Print the specified file
PrintObject Global Print the specified Object
PrintPage Global Print the specified page or page Object
Pause - Sound Sound Pauses a WAV file
random Global Get a random integer
Read File Read a file that has been opened
ReadField File Reads a field in a file that has been opened
ReadLine File Reads first line of an opened file
ReadRegistryKey Global Return the value of a specified key in the Registry
ReallyExitPublication Global Exit the publication immediately
Refresh Browsers Redisplays the current pbrowser age
RegisterEventHandler Events Set function called when set event triggers.
ReleaseMouse Graphics Release the mouse input
RemoveAllHypertext TextRemove all hypertext links for this text
RemoveAlpha Graphics Remove Alpha effect from specified object
RemoveBackground Graphics Remove Background style from specified object
RemoveBlur Graphics Remove Blur from specified object
RemoveBorder Graphics Remove Border style from specified object
RemoveBtnColour Graphics Remove Button style from specified object
RemoveFlare Graphics Remove Flare effect from specified object
RemoveImage Graphics Remove Image file from specified object
RemovePoint Frame Remove a point from the contour in the frame
RemoveShadow Graphics Remove Shadow effect from specified object
RemoveTexture Graphics Remove Texture effect from specified object
ReplaceSelection TextReplaces the current selection with a specified string
ReportClose Global Close the open log file
ReportGetFilename Global Get the filename of the current log file
ReportSetFilename Global Set the output file for logging actions
ReportWriteString Global Write a string to the current log file
ResetAnimation Graphics Reset an animation
ResetVariables Publications Reset all publications variables to their default
ResetVars Pages Reset all page properties variables
Resume Sound Sound Resumes a WAV sound previously paused
RGB Global Return a number indicating a RGB colour value
right Global Get the right end of a string
Roll Graphics Roll an object by a specified angle
Rotate Graphics Rotate an object by a specified angle
Scale Graphics Scale object horizontally & vertically by a percentage
ScaleH Graphics Scale object horizontally by a percentage
ScaleV Graphics Scale object vertically by a percentage
Scroll TextScroll the text by line, paragraph or page
Seek Sound Reposition the starting point of a sound
Seek Video Reposition the starting point of a video
SendEmail Global Send an email
SetAlpha Graphics Set Alpha effect on a specified object
SetBackground Graphics Set Background style on a specified object
SetBlur Graphics Set Blur on a specified object
SetBookmark Pages Bookmark the current page
SetBorder Graphics Set Border style on a specified object
SetBtnColour Graphics Set Button style on a specified object
SetColour TextSet the colour of text in a Text object
SetDisplayData Graphics Set display information related to an object e.g.
SetFillColour Polygons Set the fill colour of a polygon in a Vector object
SetFillColour Frame Set the fill colour for the script drawing in the frame
SetFlare Graphics Set Flare effect on a specified object
SetFocus Graphics Set the keyboard input focus
SetImage Graphics Set Image file on a specified object
SetINIFileData Global Set the value of a specified key in a specified section of an INI file
SetInitialPositionExact Chapter Set initial position of chapter window using an absolute position
SetInitialPositionPercent Chapter Set initial position of chapter window as a percentage of the screen size
SetLayer Graphics Set the layer that the object is on
SetLineColour Polygons Set the line colour of a polygon in a Vector object
SetLineColour Frame Set the line colour for the script drawing in the frame
SetLineStyle Frame Set the line style for the script drawing in the frame
SetListBoxSelection TextSet the highlighted area in a Listbox object to a new line
SetObjectDimensions Graphics Set the position and size of an object
SetPosition Graphics Set aspects of the objects position
SetPosition Sound Set the current position in seconds for a sound file
SetPositionX Graphics Set the x coordinate of the objects position
SetPositionY Graphics Set the y coordinate of the objects position
SetRoll Graphics Set an objects roll to a specified angle
SetRotation Graphics Set an object's rotation to a specified angle
SetScale Graphics Set the horizontal and vertical scale of an object to a percentage
SetScaleH Graphics Set the horizontal scale of an object to a percentage
SetScaleV Graphics Set the vertical scale of an object to a percentage
SetScrollPosition Graphics Set the scroll position of the object
SetSelection TextSelects a range of characters in the text object
SetSelectionParagraphStyle TextSet the paragraph style of selected text
SetSelectionStyle TextSet the formatting style of selected text
SetShadow Graphics Set Shadow effect on a specified object
SetSkew Graphics Skew an object horizontally and vertically to a specified angle
SetSkewH Graphics Skew an object horizontally to a specified angle
SetSkewV Graphics Skew an object vertically to a specified angle
SetSpin Graphics Set an objects spin to a specified angle
SetState Buttons Sets the current state of a push button
SetTexture Graphics Set Texture effect on a specified object
SetTransparency Graphics Set the objects transparency
SetVolume Sound Set the volume level for a specified device
SetVolume Sound Set the volume level for a specified sound Object
Show Graphics Show this object
ShowBookmarkDialog Pages Show the Bookmark Dialog box
Spin Graphics Spin an object by a specified angle
split String Split a String object into an array of strings
Start Clock Start a clock Object
Start Timelines Start a specified Timeline
Stop - Browser Browsers Stops the specified browser Object
Stop - Clock Clock Stop a clock Object
Stop - Slideshow Slideshow Stop a Slideshow
Stop - Sound Sound Stop a sound file
Stop - Timeline Timelines Stop a specified Timeline
Stop - Tween Tweens Stops the specified Tween Animation
Stop - Video Video Stop a specified video
StopAnimation Graphics Stop an animation
StopAutonarrate TextEnd the autonarration on this text
string Global Convert a value to a string
substring String Returns a substring of a specified string
TimeGetSeconds Publications Get number of seconds a publication has been running
ToEnd MultiFrames Go to last frame in the MultiFrame
ToFrame MultiFrames Go to a given frame in the MultiFrame
tolower Global Get a lower case version of a string
toLowerCase String Converts the String object to lower case
ToStart MultiFrames Go to first frame in the MultiFrame
toString Boolean Converts a Boolean object to a string
toString File Returns the type of object as a string
toString Number Converts the Number object into a string
toString String Converts the String object into a string
toupper Global Get an upper case version of a string
toUpperCase String Converts the String object to upper case
TriggerComponentEvent Events Activate a Custom Trigger for a specified object.
UnRegisterEventHandler Events Remove a previously registered event handler
valueOf Boolean Returns a primitive value of a Boolean Object
valueOf Number Returns the primitive value of the Number Object
valueOf String Returns the primitive value of the String object
word Global Get a word from a string
Write File Write a string to an opened file
WriteField File Write a string to a field in an opened file
WriteLine File Write a string to a line in an opened file
WriteRegistryValue Global Write a value to the system registry
 

Back to Top

Database Functions

 
AutoCommit  Turn AutoCommit on or off for a database
Commit  Commit to database - permanently stored on database
Connect Connect to SQL server
ExecuteSQL   The SQL database command to execute
FirstRecord   Go to First record in record set
GetCurrentRecordNumber   Get current record number in record set
GetIdentQuoteChar   Identify quote character required for table or field names containing spaces
GetLastError   Get the last database error message
GetNumberOfRecords   Get total number of records in record set
GetRecordAt   Go to a specific record number in a record set
GetRecordAtRelative   Go to a specific record number relative to current number
IsAutoCommitOn   Check if AutoCommit is on in a database
LastRecord   Go to Last record in record set
NextRecord   Go to Next record in record set
PreviousRecord   Go to Previous record in record set
Rollback   Go back to point in database before changes were made or last commit sent
 

Back to Top

Date Functions

 
Date.parse   Returns the number of milliseconds since 1/1/1970
getDate   Return the day of the month
getDay   Return the day of the week
getFullYear   Return the year
getHours   Return the hour
getMilliseconds   Return the number of milliseconds
getMinutes   Return the minutes
getMonth   Return the month
getSeconds   Return the seconds
getTime   Return the number of milliseconds since 1/1/1970
getTimezoneOffset   Return the difference between local time zone and universal time in minutes
getUTCDate   Return the day of the month in universal time
getUTCDay   Return the day of the week in universal time
getUTCFullYear   Return the year in universal time
getUTCHours   Return the hour in universal time
getUTCMilliseconds   Return the number of milliseconds in universal time
getUTCMinutes   Return the minutes in universal time
getUTCMonth   Return the month in universal time
getUTCSeconds   Return the seconds in universal time
setDate   Set the day of the month
setFullYear   Sets the year
setHours   Sets the hour
setMilliseconds   Sets the number of milliseconds
setMinutes   Sets the minutes
setMonth   Sets the month
setSeconds   Sets the seconds
setTime   Sets the time since 1/1/1970 in milliseconds
setUTCDate   Sets the date in the month in universal time
setUTCFullYear   Sets the full year in universal time
setUTCHours   Sets the hour in universal time
setUTCMilliseconds   Sets the number of milliseconds in universal time
setUTCMinutes   Sets the number of minutes in universal time
setUTCMonth   Sets the month in universal time
setUTCSeconds   Sets the seconds in universal time
toGMTString   Converts the Date object to a string adjusted to GMT (Greenwich Mean Time)
toLocaleString   Converts the Date object to a string adjusted to local time zone
toString   Converts the Date object into a string
toUTCString   Converts the Date object into a string adjusted to universal time
valueOf   Returns the value of the Date object as a number of milliseconds
 

Back to Top

Maths Functions

 
Math.abs   Returns the absolute value of a number
Math.acos   Returns the arccosine of a number (in radians)
Math.asin   Returns the arcsine of a number (in radians)
Math.atan   Returns the arctangent of a number (in radians)
Math.atan2   Returns the angle from the X-axis to a point
Math.ceil   Rounds a number up
Math.cos   Returns the cosine of a number
Math.E   Returns Euler's constant e (approx. 2.718)
Math.exp   Returns E to the power of the argument passed
Math.floor   Rounds a number down
Math.LN10   Returns the natural log of 10 (approx. 2.303)
Math.log   Returns the natural log (base E) of a number
Math.LOG10E   Returns the base 10 log of E (approx. 0.434)
Math.max   Returns the larger of two values
Math.min   Returns the smaller of two values
Math.PI   Returns PI (approx. 3.1415)
Math.pow   Returns the first parameter raised to the power of the second
Math.random   Returns a pseudo-random number between 0 and 1
Math.round   Rounds to the nearest integer
Math.sin   Returns the sine of a number
Math.sqrt   Returns the square root of a number
Math.SQRT1_2   Returns the square root of 1/2 (approx. 0.707)
Math.SQRT2   Returns the square root of 2 (approx. 1.414)
Math.tan   Returns the tangent of a number
 

Back to Top