• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changing the colour picker to another colour via script

Community Beginner ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

How can I change the colour picker fill and stroke to another colour via script?

TOPICS
Scripting

Views

783

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Apr 03, 2017 Apr 03, 2017

CHAPTER 1: JavaScript Object Reference

Page 43

Creating a document with defaults

// Creates a new document if none exists

// then sets fill and stroke defaults to true

if ( app.documents.length == 0 ) {

    doc = app.documents.add();

} else {

    doc = app.activeDocument;

}

doc.defaultFilled = true;

doc.defaultStroked = true;

*****

//With that read I pushed app.activeDocument to a variable.

var aaadoc = app.activeDocument;

// then looked in the databrowser.

db.PNG

// here you can see we have access to quite a few o

...

Votes

Translate

Translate
Adobe
Community Beginner ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

Qwertyfly...​ any ideas on this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

CHAPTER 1: JavaScript Object Reference

Page 43

Creating a document with defaults

// Creates a new document if none exists

// then sets fill and stroke defaults to true

if ( app.documents.length == 0 ) {

    doc = app.documents.add();

} else {

    doc = app.activeDocument;

}

doc.defaultFilled = true;

doc.defaultStroked = true;

*****

//With that read I pushed app.activeDocument to a variable.

var aaadoc = app.activeDocument;

// then looked in the databrowser.

db.PNG

// here you can see we have access to quite a few options for the default fill and stroke.

// these will effect your default swatch in the color panel.

// if you have anything selected when you tweek these values, it will effect your selection!

Hope that helps

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Worked like a charm!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

LATEST

glad I could help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines