Page 1 of 1

Get strokecolor of selected Polygon

Posted: Thu May 18, 2017 9:50 am
by magthenop
Hi!

How can I get the strokecolor of a selected Polygon?

i have tried with a number of things,
This is the latest (but it does not work):

'a = this.selectedAnnots; if (a.length) { var p = a[0].getProps(); p.strokecolor; };';

I am executing this string with RunJavaScript and want to get a string in return that I can use on another object.

Re: Get strokecolor of selected Polygon

Posted: Thu May 18, 2017 10:28 am
by Tracker Supp-Stefan
Hello magthenop,

Properties names are case sensitive. The below (executed in the end user Editor through the JS console, does print out "RGB,1,0,0" for a selected polygon object with red colour:

Code: Select all

a = this.selectedAnnots; if (a.length) { var p = a[0].getProps(); p.strokeColor; };
console.println(p.strokeColor);
Regards,
Stefan

Re: Get strokecolor of selected Polygon

Posted: Thu May 18, 2017 11:04 am
by magthenop
:-) Jepp, that did the trick!
Thanks

Re: Get strokecolor of selected Polygon

Posted: Thu May 18, 2017 11:49 am
by Tracker Supp-Stefan
:)