Node Script

Get Device Os Name

Downloads: 33
Download
Ads Support FTD

Description

Outputs the devices Operating systems name

//
// GetDeviceOsName.ts
// Gets the device OS name
// Written by @Fusedthreed – https://FusedThreeD.com
//

@customNode()
export class GetDeviceOsName extends BasicScriptNode {

  @output()
  osName: string;

  execute() {
    const os = APJS.DeviceInfo.getOS();    
    if (os === APJS.OS.Android) this.osName = "Android";
    else if (os === APJS.OS.IOS) this.osName = "iOS";
    else if (os === APJS.OS.Windows) this.osName = "Windows";
    else if (os === APJS.OS.MacOS) this.osName = "MacOS";
    else if (os === APJS.OS.Linux) this.osName = "Linux";
    else if (os === APJS.OS.HarmonyOS) this.osName = "HarmonyOS";
    else this.osName = "Unknown";
  }
}
Ads Support FTD