I have a .ai file which has a layer containing a bunch of nested outline objects (pathItem, compoundPathItems, ClipGroup, etc.). Example - a linear barcode containing rectangular lines with digits below. Is there a way to locate this barcode on the .ai file and read the vetcor image to decode its content ?
Illustrator sees paths that's all.
It then sees if the path is open or closed and if there's a stroke or fill applied to the path.
Illustrator does not, and has never, "interpreted" or "read" what those paths may comprise. It sees the drawing of a kitten the exact same way as it sees outlined text which makes up the word "kitten".
Illustrator is not capable of "barcode scanning" to determine the code contents. Or interpreting any cognitive meaning from objects.
Well obviously it would be possible for you to implement this. It wold just be quite a bit of work on the scripting layer. How well it would work depends on how much effort you want to put into it.
But the gist of implementing this is organising the data in such a way that you have a easy time to do this. As said in other answers from a pure programmatic point of view there is no difference between a barcode and anything else in the drawing. I guess youd organize edges by their coplanarity or do some raycasting.
Is it builtin? No. Would it ve useful? Probably for less than 0.1% of users. How much would it cost to have this implemented? Depends a bit how you want it to work but somewhere around 40 manhours for a crappy prototype/hack and 120-200 hours for a decent implementation. So somewhere around 2000-10000€. So now the question is how much is it worth to you?