The platformservice interface provides information about the system that modo is running on. This includes the user that the application is licensed to, the application version, and operating system information.
- 1 Attributes
- 2 Application Information
- 3 Headless Operation
- 4 Operating System Information
- 5 Paths
- 6 importpaths
- 7 Resolving Aliases
- 8 More Information
Querying the platformservice ScriptQuery interface reveals ten root attributes and one attribute group:
Basic licensing information can be read with these attributes, including the name of the licensed owner of the application and how long before the license key expires.
Get the name of the licensed modo user. Returns the string (unregistered), localized to the current language, if the application is not licensed.
|Example||query platformservice licensedto ?|
Get the number of days before the license key expires. If this is a permanent key, this returns -1.
|Example||query platformservice expiresin ?|
Get the serial number of a licensed application. This is only valid when licensed to does not return (unregistered).
|Example||query platformservice serialnum ?|
|Result||[serial number of the license]|
Get the number of machines that this license supports. This is only valid when licensed to does not return (unregistered).
|Example||query platformservice numlicenses ?|
Basic application information can be read with these attributes, including the name of the application and the version and build numbers.
Get the name of the application. For modo, this will be the string modo.
|Example||query platformservice appname ?|
Get the version number of the application.
|Example||query platformservice appversion ?|
Get the build number of the application.
|Example||query platformservice appbuild ?|
Returns true if the application itself is 64 bit, and false if it is 32 bit. This does not report if the OS is 64 or 32 bit, just if the application itself is.
|Example||query platformservice isapp64bit ?|
The nexus infrastructure supports running in a headless mode without a user interface.
Returns true if the application is running without a user interface.
|Example||query platformservice isheadless ?|
Operating System Information
Get the operating system type. This will be MacOSX, Win32 or Linux.
|Example||query platformservice ostype ?|
Get a more human-readable operating system name.
|Example||query platformservice osname ?|
|Result||Mac OS X 10.7.3|
Get a version string from the operating system. The format is dependent on the OS. For example, Windows will commonly include the service pack as well.
|Example||query platformservice osversion ?|
This attribute returns a list of file system paths used by modo. See Path Aliases: Standard Paths for more information.
Get a list of paths names used by modo.
|Datatype||query platformservice paths ?|
|Example||[list of paths]|
The path attributes are used to obtain information about a path alias. The internal name of the path is used as the selector. Currently only one attribute is defined, which resolves the internal name into an absolute file system path.
Get the alias's absolute file system path.
|Datatype||query platformservice path.path ? temp|
The import paths attribute is used to get a list of all imported resource paths. These paths are used for the default location for scripts and icons, and are scanned on startup for auxiliary config files.
Get the imported resource paths.
|Datatype||query platformservice importpaths ?|
|Example||[list of all imported paths]|
The alias attribute resolves an alias into an absolute path. This can be used with any aliases the user may have created, or the implicit alias defined by a kit. If the alias cannot be resolved, this will return the original alias passed in. The alias can include subdirectories, which will be included in the returned string. This may not work with all aliases explicitly defined by modo itself; those can be read with paths and path.path as described above. It can also be used to resolve kit aliases into absolute paths. The selector is the name of the alias to resolve, including any option subdirectories.
Resolve a path alias into an absolute path.
|Datatype||query platformservice alias ? "myAlias:SubDir"|
|Example||[absolute path of the alias]/SubDir|