PCkEG‖ScriptForge.Platform service

7D6Dx‖The Platform service provides a collection of properties about the current execution environment and context, such as:

note

ZvBqs‖All properties of the Platform service are read-only.


iK4Gv‖Service invocation

dogmo‖Before using the Platform service the ScriptForge library needs to be loaded or imported:

note

• Basic macros require to load ScriptForge library using the following statement:
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")

• Python scripts require an import from scriptforge module:
from scriptforge import CreateScriptService


mHGZk‖The examples below in Basic and Python instantiate the Platform service and access the Architecture property.

3aa4B‖In Basic

      GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
      Dim platform As Variant
      platform = CreateScriptService("Platform")
      MsgBox platform.Architecture
    
BenDd‖In Python

      from scriptforge import CreateScriptService
      svc = CreateScriptService("Platform")
      bas = CreateScriptService("Basic")
      bas.MsgBox(svc.Architecture)
    

KC5eN‖Properties

VXJ8a‖Name

JN68D‖Readonly

ZndAt‖Type

dAoKA‖Description

Architecture

XdLGG‖Yes

String

EEWuL‖The hardware bit architecture. Example: '32bit' or '64bit'

ComputerName

8EZ8A‖Yes

String

iG4iH‖The computer's network name.

CPUCount

hvAeY‖Yes

Integer

v3N6U‖The number of central processing units.

CurrentUser

89Lo8‖Yes

String

rmGRV‖The name of the currently logged user.

Extensions

rCN2h‖Yes

T2MVx‖String array

5Fkqe‖Returns a zero-based array of strings containing the internal IDs of all installed extensions.

Fonts

9aGdF‖Yes

yuuvA‖String array

BvYt3‖Returns a zero-based array of strings containing the names of all available fonts.

FormatLocale

86VFG‖Yes

String

9qBZR‖Returns the locale used for numbers and dates as a string in the format "la-CO" (language-COUNTRY).

Locale

Av85C‖Yes

String

sYrDn‖Returns the locale of the operating system as a string in the format "la-CO" (language-COUNTRY). This is equivalent to the SystemLocale property.

Machine

Dt7J5‖Yes

String

LA6EN‖The machine type. Examples are: 'i386' or 'x86_64'.

OfficeLocale

LbQr2‖Yes

String

ZZcSc‖Returns the locale of the user interface as a string in the format "la-CO" (language-COUNTRY).

OfficeVersion

tqwyD‖Yes

String

WLRju‖The actual LibreOfficeDev version expressed as
' LibreOfficeDev w.x.y.z (The Document Foundation)'.

2q29b‖Example: 'LibreOffice 7.4.1.2 (The Document Foundation, Debian and Ubuntu)'

OSName

7WDer‖Yes

String

NUSby‖The operating system type. Example: 'Darwin, Linux' or 'Windows'.

OSPlatform

cLiaw‖Yes

String

nepQ6‖A single string identifying the underlying platform with as much useful and human-readable information as possible.

EH36m‖Example: 'Linux-5.8.0-44-generic-x86_64-with-glibc2.32'

OSRelease

hbyth‖Yes

String

4iEvV‖The operating system's release. Example: '5.8.0-44-generic'

OSVersion

2fBtD‖Yes

String

iukPq‖The operating system's build or version.

DWQNA‖Example: '#50-Ubuntu SMP Tue Feb 9 06:29:41 UTC 2021'

Printers

E8DzK‖Yes

String
array

ArFcn‖The list of available printers as a zero-based array.

nN5EG‖The default printer is put in the first position of the list (index = 0).

Processor

fCdYi‖Yes

String

wkthE‖The real processor name. Example: 'amdk6'.

MYY9M‖This property may return the same value as the Machine property.

PythonVersion

yWwgE‖Yes

String

Rw373‖Returns the version of the Python interpreter being used as a string in the format "Python major.minor.patchlevel" (ex: "Python 3.9.7").

SystemLocale

Ad9Cw‖Yes

String

Aue6E‖Returns the locale of the operating system as a string in the format "la-CO" (language-COUNTRY). This is equivalent to the Locale property.


EFSA4‖Example:

FJs9t‖The following examples in Basic and Python illustrate how to use the Fonts property to write the names of all available fonts to the current Calc sheet starting at cell "A1":

3aa4B‖In Basic

      Dim oDoc as Object
      Dim allFonts as Object
      Dim svcPlatform as Object
      Set oDoc = CreateScriptService("Calc")
      Set svcPlatform = CreateScriptService("Platform")
      allFonts = svcPlatform.Fonts
      oDoc.setArray("~.A1", allFonts)
    
BenDd‖In Python

      from scriptforge import CreateScriptService
      svc_platform = CreateScriptService("Platform")
      doc = CreateScriptService("Calc")
      all_fonts = svc_platform.Fonts
      doc.setArray("~.A1", all_fonts)
    
warning

uzETY‖All ScriptForge Basic routines or identifiers that are prefixed with an underscore character "_" are reserved for internal use. They are not meant be used in Basic macros or Python scripts.