Skip to main content
dublove
Legend
June 24, 2025
Answered

Is there any way to read my machine code?

  • June 24, 2025
  • 2 replies
  • 488 views

Do I want to get my machine .
Can a script in InDesign do it?

Correct answer Kasyan Servetsky

Here's an example (for Windows only) of getting to computer hardware from InDesign — network adapter Name/MAC/Speed script — by calling VBScript from JavaScript.

2 replies

Kasyan Servetsky
Kasyan ServetskyCorrect answer
Legend
June 25, 2025

Here's an example (for Windows only) of getting to computer hardware from InDesign — network adapter Name/MAC/Speed script — by calling VBScript from JavaScript.

dublove
dubloveAuthor
Legend
June 25, 2025

Hi Kasyan Servetsky

Thank you very much.
This one is worth referring to.

 

Community Expert
June 24, 2025

I am not sure what is machine code that you are referring to. However, you can try to use the getenv method which can get value of a environment variable. So if you can find which environment variable holds this machine code you can use the code like following

$.getenv(/*environment variable name*/)

-Manan

-Manan
dublove
dubloveAuthor
Legend
June 24, 2025

Hi Manan Joshi

Can you be more specific?

I'm a little confused.

 

Perhaps it's okay to have access to CPU or Motherboard information.

Found this one, but it seems to have a lot of errors.

// 生成唯一ID的函数(Functions to generate unique IDs)
function generateUniqueId() {
    return 'xxxxxxxx-xxxx-4xxxyxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

// 检查LocalStorage中是否已有唯一ID(Check if there is already a unique ID in LocalStorage)
if (!localStorage.getItem('uniqueId')) {
    const uniqueId = generateUniqueId();
    localStorage.setItem('uniqueId', uniqueId);
    console.log('Newly generated unique ID:', uniqueId);
} else {
    console.log('Existing Unique ID:', localStorage.getItem('uniqueId'));
}

 

Community Expert
June 25, 2025

What I meant is that the method I listed can read the environment variable. So if the information that you want is or can be set in an environment variable you can use that method to read it. The code you listed seems to be a CEP extension code so that won't work in jsx file. Another option is to call up Applescript/VBScript from jsx. Applescript/VBScript can pull up the information using OS level functions

-Manan

-Manan