Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to get OS type in JS without callback wrapper

Community Beginner ,
Jan 26, 2021 Jan 26, 2021

Hi, i want to get OS type without callback wrapper

 

let say in JS code if i do

 

getOStype(); // it should give either MAC or Windows

 

QUESTION: i want to avoid callback wrapper  

getOStype(function(ostype){
    //os type
});

 

Here is how i'm doing 

.jsx file

 

$._QEPPRO_={
     getOStype: function(){
         if (Folder.fs == 'Macintosh') {
            return 'MAC'
        } else {
            return 'WINDOWS';
        }
     }
};

var csInterface = new CSInterface();
csInterface.evalScript('$._QEPPRO_.getOStype()',function(osType){
      // osType
});

 

TOPICS
How to , SDK
454
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Jan 27, 2021 Jan 27, 2021
console.log(process.platform);
// returns "darwin" for mac
// returns "win32" for win
// I think you should have nodejs enabled in manifest.xml

var csInterface = new CSInterface(); //
console.log(csInterface.getOSInformation());
// mac example: "Mac OS X 10.14.6"
// win example: "Windows 10 64-bit"
Translate
Contributor ,
Jan 27, 2021 Jan 27, 2021
LATEST
console.log(process.platform);
// returns "darwin" for mac
// returns "win32" for win
// I think you should have nodejs enabled in manifest.xml

var csInterface = new CSInterface(); //
console.log(csInterface.getOSInformation());
// mac example: "Mac OS X 10.14.6"
// win example: "Windows 10 64-bit"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines