Get details about guides
Posted: Mon Jun 25, 2012 9:29 am
For what it’s worth, since CS5, it’s also possible to get the number of guides this way using Action Manager code:
Code: Select allvar $s = function (s) { return app.stringIDToTypeID(s); };
var num_guides_ref = new ActionReference;
num_guides_ref.putProperty($s('property'), $s('numberOfGuides'));
num_guides_ref.putEnumerated($s('document'), $s('ordinal'), $s('targetEnum'));
var num_guides = app.executeActionGet(num_guides_ref).getInteger($s('numberOfGuides'));
And it’s possible to get the guides by index inside the current document. What’s kind of odd about this is that 'numberOfGuides' doesn’t actually show up in the document descriptor. To get access, you have to ask for it explicitly like this. Yet another weird inconsistency. :/
Code: Select allvar $s = function (s) { return app.stringIDToTypeID(s); };
var num_guides_ref = new ActionReference;
num_guides_ref.putProperty($s('property'), $s('numberOfGuides'));
num_guides_ref.putEnumerated($s('document'), $s('ordinal'), $s('targetEnum'));
var num_guides = app.executeActionGet(num_guides_ref).getInteger($s('numberOfGuides'));
And it’s possible to get the guides by index inside the current document. What’s kind of odd about this is that 'numberOfGuides' doesn’t actually show up in the document descriptor. To get access, you have to ask for it explicitly like this. Yet another weird inconsistency. :/