How to get Photoshop OS info (Mac or Win) in UXP JavaScript?

Contributor ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

I'm converting CEP/ExtendScript to UXP JavaScript.

 

Is there way to tell if the system is Mac or Win in UXP JavaScript?

 

OS info (Mac or Win) can be get as following in CEP environment.

 

// CEP JavaScript
var isMac = (navigator.platform == "MacIntel");

// ExtendScript
var isMac = (0 == $.os.indexOf("Mac"));

 

 

But I could not find on UXP JavaScript environment.

 

How can I get this info (Mac or Win) in UXP Scripting?

 

Note: I checked around API doc, global object and require('photoshop') objects, but I could not find.

TOPICS
Actions and scripting

Views

83

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

correct answers 1 Correct Answer

Adobe Community Professional , Jul 14, 2021 Jul 14, 2021
I don't know anything about it at all. But I guess require('os').platform() Not? : )

Likes

Translate

Translate
Adobe Community Professional ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

UXP Plugin Photoshop + Read write XMP data + XMP lib:AdobeXMPScript
I link these UXP threads to show there are no answers for aksed questions.

Did you try on dedicated UXP forum? Did anyone answer over there?

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
community guidelines
Contributor ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

In general, pointing wroing direction is not appriciated.

I don't think there is dedicated UXP forum as up current.

UXP is already in PS.

But CEP plugin has no support on M1 Native Photoshop.

Other apps except Photoshop are announced support CEP11 on M1 Native.

To make plugin work on M1 Native, UXP is only way curretnly available.

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
community guidelines
Adobe Community Professional ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

LATEST

So you say that participation on the forum lead by creators of UXP who actively are in touch with users is wrong direction? But staying on 'desert' where you can get a tip by luck is okay?

 

You don't think there's dedicated UXP forum? Why, if someone is guaranting it to you? What are your reasons to say so? You just can go there and see it on your own, can't you? 😕

 

CEP for Photoshop has also its own forum, but probably you wouldn't appreciate my good will to show you right direction 😉 "I want it to be that, so this is what I believe it is", really?

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
community guidelines
Adobe Community Professional ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

I don't know anything about it at all.

 

But I guess

require('os').platform()

 

Not? : )

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
community guidelines
Community Beginner ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

@r-bin 

It works!

Thank you very much.

 

ss_20210715_094043_019.png

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