Copy link to clipboard
Copied
Hi All,
Is it possible to get system unique id (mac or pc any) with indesign javascript.
Any information would be greatly appreciated.
Shonky
The serial number is the InDesign one (although it's the shortened 20 digit one -- not the full 24 digit one, and in CS4 it's jumbled up).
The (APID unique) system id only works in APID version1.0.47 and later.
Harbs
Copy link to clipboard
Copied
Hi Shonky,
I thnink there is no id for the Application.
Instead yu can declare Label to application.
Eg: For 10 systems you can declare Sys1, Sys2,...Sys10.
Code: app.label = "Sys1";
Regards,
Ramkumar .P
Copy link to clipboard
Copied
Hi Ramkumar,
Actually i want my computer id or you can say computer serial number not application id.
Shonky
Copy link to clipboard
Copied
http://www.rorohiko.com/wordpress/indesign-downloads/active-page-item-developer/
Harbs
Copy link to clipboard
Copied
Thank you Harbs,
I don't want use any plugin. I am trying to find in javascript. I have a script that can find user name so i thought that computer id or serial no. is possible too.
Shonky
Copy link to clipboard
Copied
If APID is loaded, you can get the serial number or unique system id
with scripting. Otherwise, you're on your own...
Harbs
Copy link to clipboard
Copied
Harbs can you give me javascript code. Is this code work with demo APID.
Thanks,
Shonky
Copy link to clipboard
Copied
var theSystemID = app.callExtension(0x90B6C,10022);
var theSerial = app.callExtension(0x90B6C,10011);
Harbs
Copy link to clipboard
Copied
Thank you very much Harbs,
But theSystemID showing undefined and serial no is not matching with my machine serial no.
Any suggestion?
Shonky
Copy link to clipboard
Copied
The serial number is the InDesign one (although it's the shortened 20 digit one -- not the full 24 digit one, and in CS4 it's jumbled up).
The (APID unique) system id only works in APID version1.0.47 and later.
Harbs
Copy link to clipboard
Copied
Thanks again Harbs for your valuable response.
One last question. How i know all the code of APID like system id, serial no. etc.
Shonky
Copy link to clipboard
Copied
Donwload the Toolkit. There's reference manuals in the download.
Harbs
Copy link to clipboard
Copied
do shell script ("system_profiler SPHardwareDataType | grep \"Serial Number\" | awk '{print $3}'")
works on my tiger box… so you may be able to do this with app.doScript()
Copy link to clipboard
Copied
Thanks Mark and Harbs,
Thanks but your code not working on leopard. I have found below code which is working.
do shell script ("system_profiler SPHardwareDataType | grep \"Serial Number\"")
How can I store this in a variable. I have not idea for applescript.
Shonky
Copy link to clipboard
Copied
You could just have Applescript get the last word of the whole output of system profiler?
This works again only tested on tiger…
if (File.fs == 'Macintosh') {
var systemProfile = ''
+ 'set SerialNumber to last word of (do shell script "system_profiler SPHardwareDataType")' + '\n'
+ 'return SerialNumber'
var scriptResult = app.doScript(systemProfile, 1095978087);
$.writeln(scriptResult);
}
Copy link to clipboard
Copied
The serial number you're getting is not reliable. If the Mac has been repaired or the disk drive replaced, you may not get any value returned.