Temporary Uuid

AiScripts
Oct 30, 2023

--

As of CC 2020, the uuid string key (a unique object identifier) has been added to the Adobe Illustrator object model. It is readable and can be used to retrieve a specific object in a script using the getPageItemFromUuid() method. For example, if you know the object identifier, you can move it:

var obj = app.activeDocument.getPageItemFromUuid(439);
obj.translate(100, 0);

When you create an object, it gets a temporary uuid that is valid until you close the saved document. When you close it, the object’s new uuid is written to the file.

An 1346458189 (‘MRAP’) error will occur if you try to get the object using the old (temporary) uuid.

If the script saves the object uuid to the preferences file for further work, you should save and reopen the document before running the script so that the object uuid is fixed. Otherwise, at best you will save a useless temporary identifier, at worst the script will not work and an error will occur.

--

--

AiScripts

Sergey Osokin. Product Illustrator, Icon Designer, Script Developer (Ai, Ps). Writing about bugs and tricks in Adobe Illustrator scripts