Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Properties property example javascript in Adobe introduction to scripting doesn't work?

$
0
0

I'm completely new to scripting so I figured I'd start with the Adobe guide to scripting pdf.

On page 18 it gives examples of 3 ways to use properties. The first 2 work just fine, but the third just ignores the properties part even when I directly copy paste it.

This is the bit:

 

JS also provides a properties property, which allows you to define several values in one statement. You

enclose the entire group of values in curly braces ({}). Within the braces, you use a colon (:) to separate a

property name from its value, and separate property name/property value pairs using a comma (,).

 

var myDoc = app.documents.add()

var myLayer = myDoc.layers.add()

myLayer.properties = {name:"My New Layer", visible:false}

 

So I know for Photoshop you have to use ArtLayers, but even in Illustrator it just adds another layer without renaming or setting the visibility.

Anybody have any idea why it doesn't work?


Viewing all articles
Browse latest Browse all 12845

Trending Articles