Global Methods: Difference between revisions
(Created page with "right|50px|link=Vectric Lua Interface for Gadgets Most of the actions you can perform from Lua are done by calling methods on objects associated with the cur...") |
No edit summary |
||
Line 1: | Line 1: | ||
[[File:Back.jpg|right|50px|link=Vectric Lua Interface for Gadgets]] | [[File:Back.jpg|right|50px|link=Vectric Lua Interface for Gadgets]] | ||
Most of the actions you can perform from Lua are done by calling methods on objects associated with the current job. There are a few methods which operate Globally on the application and they are documented here. | <p>Most of the actions you can perform from Lua are done by calling methods on objects associated with the current job. There are a few methods which operate Globally on the application and they are documented here.</p> | ||
[[Category:SDK]] | [[Category:SDK]] | ||
=== IsAspire() === | === IsAspire() === |
Revision as of 21:42, 3 August 2021
Most of the actions you can perform from Lua are done by calling methods on objects associated with the current job. There are a few methods which operate Globally on the application and they are documented here.
IsAspire()
Returns true if the script is running inside Aspire.
IsBetaBuild()
Returns true if this is a Beta build rather than a release build
GetAppVersion()
Returns application version number as a double (e.g 4.004 for Aspire V4.0)
GetBuildVersion()
Returns application internal build version which is the same for both Aspire and VCarve Pro. This is different to the AppVersion above as Aspire 4.004 will report e.g. 7.004 which matches VCarve Pro 7.004 as they are built off the same code base and have the same script level support.
MessageBox( string text)
Displays a message box with passed text to user. The text can include HTML formatting. text – string – text to display in the message box
Usage Syntax:
MessageBox("Hello World!!!")
Example Code: ThisAppInfo
--[[ | ThisAppInfo() Collects information about the application and | provides the user with the following: | Application name | If the version is a Beta | The version number | The build number ]] function ThisAppInfo() local ThisApp = "" if IsAspire() then ThisApp = "Aspire" else ThisApp = "VCarve Pro" end -- if end if IsBetaBuild() then ThisApp = ThisApp .." is a IsBeta" end -- if end ThisApp = ThisApp .. " Version: " .. tostring(GetAppVersion()) .. "\n Build: " tostring(GetBuildVersion()) MessageBox("Current application informaction: " .. ThisApp) end -- function end
function main() ThisAppInfo() return true end -- function end </nowiki>
References
Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 2.05, published September 12, 2018. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information