Are you able to execute this method with hardcoded value for the valueParam as well, it should work fine. If you get it working with the hardcoded values then i suppose it is the first statement wherein you are trying to get the values has some problems regarding the datatype or other stuff. I have been using this method without any problems.
- Efficient InDesign Solutions
- MetaDesign Solutions
I have try with an hardoded value like "id" in key and "0" in value.
The generation will crash too.
Do you have another suggestion ?
Is the value you're passing in a string? Try with "0" rather than 0, or use a word like "test". If you want to convert a number to a string you can use Number(n).toString(). This works for me:
var doc = app.documents.add();
var page = doc.pages.add();
var rect = page.rectangles.add();
alert(rect.extractLabel("id")); // Shows 3
Incidentally, you might want to avoid using a label like id - other developers might use the same key to signify something else. A better key might be something like "<your product name>_id".
Hope that helps,
I moved this discussion to the scripting forum because it's not an SDK discussion.