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

How to detect the OS with ExtendScript?

Participant ,
Mar 01, 2013 Mar 01, 2013

Copy link to clipboard

Copied

I'd like to detect the Operating System that After Effects in running on with ExtendScript.  Maybe there is an object method that returns a string with an identifier?  Is this possible, and if so, how is it acheived?

Thanks for your help!

TOPICS
Scripting

Views

3.0K

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
community guidelines
Participant ,
Mar 01, 2013 Mar 01, 2013

Copy link to clipboard

Copied

Sorry just found it in the guide.  My apologies.

Example

alert ("Your OS is " + system.osname + " running version " + system.osversion); confirm("You are: " + system.userName + " running on " + system.machineName + ".");

Votes

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
community guidelines
Participant ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

I remember something different from what you give in the example. First I think osname spells with an uppercase "N": system.osName, but I also believe that it can sometimes return an empty string.

I think it's safer to use first system.osName and then $.os if the string was empty.

Votes

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
community guidelines
Contributor ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

I think it is moved to $ object.

Sample
alert($.os);

Thank you,

Naoki

Votes

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
community guidelines
Participant ,
Sep 02, 2017 Sep 02, 2017

Copy link to clipboard

Copied

Hey! Just a random subquestion. In what way is $ useful? I found it mentioned 3 times in the guide. -> They say 3 things about it:

that it is

global debugging object, whatever that means,

$.locale designated the operating systems language,

$.os is the operating system name

Is that it? Is there some other functionality I am not aware of?

Votes

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
community guidelines
Contributor ,
Sep 02, 2017 Sep 02, 2017

Copy link to clipboard

Copied

TimSx​

$ object is noted Helper object.

If you check on Data Browser in ESTK, you may find something useful for you.

capture_20170902_153351.png

Votes

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
community guidelines
Advocate ,
Sep 02, 2017 Sep 02, 2017

Copy link to clipboard

Copied

To get more info about the object, you can always reflect its properties and methods:

var properties = object.reflect.properties.join(",\n");

var methods = object.reflect.methods.join(",\n");

Just change object to whatever AE object you want to reflect.

Votes

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
community guidelines
Community Expert ,
Sep 02, 2017 Sep 02, 2017

Copy link to clipboard

Copied

There's about 5 pages on the $ object in the JavaScript Tools Guide. My favorite function is probably $.writeln(), which I use extensively during debugging.

Dan

Votes

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
community guidelines
Participant ,
Sep 03, 2017 Sep 03, 2017

Copy link to clipboard

Copied

LATEST

Thank you all!

Votes

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
community guidelines