Highlighted

How to read the operating system with a javascript

Explorer ,
Jun 02, 2020

Copy link to clipboard

Copied

Hi,

I would need to change in After Effects the path to the output directory depending on the operating system. If the script will run on a MAC the path will be different than the path on a PC.

Is there a way to read in the javascript which operation system I am on?

Cheers!

That's very cool!

Thank you very much Mathias!

I also wanted to share how I was able to use it in my script.

//alert($.os);
if($.os.indexOf("Windows") > -1){
    var strOS = "Windows";
}else if($.os.indexOf("Macintosh") > -1){
    var strOS = "Mac";
}
alert(strOS);

A.

TOPICS
Expressions, Resources, Scripting, SDK

Views

376

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to read the operating system with a javascript

Explorer ,
Jun 02, 2020

Copy link to clipboard

Copied

Hi,

I would need to change in After Effects the path to the output directory depending on the operating system. If the script will run on a MAC the path will be different than the path on a PC.

Is there a way to read in the javascript which operation system I am on?

Cheers!

That's very cool!

Thank you very much Mathias!

I also wanted to share how I was able to use it in my script.

//alert($.os);
if($.os.indexOf("Windows") > -1){
    var strOS = "Windows";
}else if($.os.indexOf("Macintosh") > -1){
    var strOS = "Mac";
}
alert(strOS);

A.

TOPICS
Expressions, Resources, Scripting, SDK

Views

377

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 02, 2020 0
Adobe Community Professional ,
Jun 02, 2020

Copy link to clipboard

Copied

function isWindows(){
return $.os.indexOf("Windows") != -1;
}


/* \brief returns true if we are on a Mac system */
function isMacOS(){
return !isWindows();
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 02, 2020 0
Explorer ,
Jun 02, 2020

Copy link to clipboard

Copied

That's very cool!

Thank you very much Mathias!

I also wanted to share how I was able to use it in my script.

//alert($.os);
if($.os.indexOf("Windows") > -1){
    var strOS = "Windows";
}else if($.os.indexOf("Macintosh") > -1){
    var strOS = "Mac";
}
alert(strOS);

A.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 02, 2020 0