@r-bin – thank you for taking an interest.
Error: The requested property does not exist. 53
Sorry, it’s reported on line 53. Here are lines 52 and 53 for context from the previous code posted:
var desc1 = app.getCustomOptions('7a301ec0-afde-11e1-afa6-0800200c9a66');
var layerGuides = eval(desc1.getString(0));
This is why I believe the AM code for an environment variable is the issue in 2024. Not knowing about AM environment variables, I thought that just using a DOM environment variable would be a quick fix, but I have only had intermittent success using them.
There is another error generated:
Error 21: undefined is not an object.
Line: 56
-> var ar1 = layerGuides.toString().split('¬');
Sorry, it’s reported on line 53. Here are lines 52 and 53 for context from the previous code posted:
var desc1 = app.getCustomOptions('7a301ec0-afde-11e1-afa6-0800200c9a66');
var layerGuides = eval(desc1.getString(0));
By @Stephen Marsh
Could you use a key value other than 0 when using the putString and getString function?
It seems that the getCustomOptions function still returns the found descriptor and does not generate an error.
Many built-in scripts use the putCustomOptions and getCustomOptions functions.
If the reason is their incorrect operation, then they may also stop working correctly.
These include Fit Image.jsx, Export Layers To Files.jsx and many others.
If getCustomOptions does not work in these scripts, then this is an obvious bug that needs to be fixed.
ADD.
Also try using putCustomOptions without "true" as the third argument,
i.e. use only the first two - name and descriptor.