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

Is there any way to read my machine code?

Guide ,
Jun 24, 2025 Jun 24, 2025

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

TOPICS
Scripting
385
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

Valorous Hero , Jun 25, 2025 Jun 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.

Translate
Community Expert ,
Jun 24, 2025 Jun 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

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
Guide ,
Jun 24, 2025 Jun 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'));
}

 

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
Community Expert ,
Jun 24, 2025 Jun 24, 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

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
Guide ,
Jun 25, 2025 Jun 25, 2025

Still no direction. Still using js would be nice.
It would also be nice to get the motherboard or CPU ID.

 

Desperate for guidance from the gods.

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
Guide ,
Jun 25, 2025 Jun 25, 2025

HI Manan Joshi

Can nod.js be used in ID?

   const os = require('os');
   const si = require('systeminformation');
   async function getMachineCode() {
     const cpuInfo = await si.cpu();
     const diskInfo = await si.diskLayout();
     const motherboardInfo = await si.baseboard();
     return {
       cpuSerial: cpuInfo.serial,
       diskSerial: diskInfo[0].serialNum,
       motherboardSerial: motherboardInfo.serial
     };
   }

 

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
Guide ,
Jun 24, 2025 Jun 24, 2025

It seems to say that the role of Js is external interaction.
Doing this is unlikely.

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
Valorous Hero ,
Jun 25, 2025 Jun 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.

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
Guide ,
Jun 25, 2025 Jun 25, 2025
LATEST

Hi Kasyan Servetsky

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

 

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