Jump to content

 
Photo

Javascript in Illustrator

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Brian Moran

Brian Moran

    Contributor

  • Validated Member
  • PipPip
  • 32 posts
  • Gender:Male
  • Location:Bay Area, California
  • United States

Anyone know of a way to call sublayers by name in JS?

Trying to get a script to work on a AI file that has been exported out of arcMap, in which almost all the layers are actually sublayers of a few top level layers.

For instance, the line
var targetLayer = myDoc.layers.getByName ("Road - Dirt (base)")
does not find the layer "Road - Dirt (base)" unless it is a top-level layer. I can't find any reference to sublayers in any of the Adobe documentation.

#2
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

The layer object has a property 'layers' which is the collection of sublayers.
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#3
Brian Moran

Brian Moran

    Contributor

  • Validated Member
  • PipPip
  • 32 posts
  • Gender:Male
  • Location:Bay Area, California
  • United States

Great, thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->