Get system unique id

Engaged ,
Feb 07, 2010

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

TOPICS
Performance, Product issue, Scripting

Views

2.5K

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

LEGEND , Feb 08, 2010
Harbs. LEGEND , Feb 08, 2010
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

Likes

Translate

Translate
Jump to answer Jump to answer
Contributor ,
Feb 07, 2010

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



Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Feb 07, 2010

Copy link to clipboard

Copied

Hi Ramkumar,

Actually i want my computer id or you can say computer serial number not application id.

Shonky

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Feb 07, 2010

Copy link to clipboard

Copied

http://www.rorohiko.com/wordpress/indesign-downloads/active-page-item-developer/

Harbs

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Feb 08, 2010

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Feb 08, 2010

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Feb 08, 2010

Copy link to clipboard

Copied

Harbs can you give me javascript code. Is this code work with demo APID.

Thanks,

Shonky

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Feb 08, 2010

Copy link to clipboard

Copied

var theSystemID = app.callExtension(0x90B6C,10022);

var theSerial = app.callExtension(0x90B6C,10011);

Harbs

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Feb 08, 2010

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Feb 08, 2010

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Feb 08, 2010

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Feb 08, 2010

Copy link to clipboard

Copied

Donwload the Toolkit. There's reference manuals in the download.

Harbs

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Guru ,
Feb 08, 2010

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()

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Feb 08, 2010

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Guru ,
Feb 08, 2010

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);

}

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Advocate ,
Feb 08, 2010

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.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more