Skip to main content
Participant
December 9, 2020
Answered

VBscript : how to change the colour of a Pluginitem

  • December 9, 2020
  • 2 replies
  • 413 views

Hello the Community,

 

I got a headache as I tried to find the correct way of scripting to apply a colour change to a Plugitem !

Anyone can help me ? (in VBScript).

 

In case of Groupitems I can do with such a script:

Set mycolor = docref.swatches(10)

set mygroup = docref.groupitems("MyGroup")

for each piece in mygroup.pathitems
piece.fillcolor = mycolor.color
next

 

So I expected to apply the same approach with Pluginitems but it doesn't work.

And even I use, for example, 2 pathitems to create the Pluginitem I don't find how to access these included elements after its creation...

In the "Scripting Reference Document" there is no Property keyword designing the "item" contained in the Pluginitem...

 

Thanks for your help

Bruno

This topic has been closed for replies.
Correct answer CarlosCanto

pluginItems can be any number of objects ie tracing object, compound Shapes, paths from Photoshop, Envelopes, etc.

 

what kind of object is your plugin item? if it's a compound shape, you need to expand it to convert it to a compoundPath, then you can access it's path items.

 

to expand the compound Shape, make sure it's selected before running

app.executeMenuCommand ('expandStyle'); // convert to compound paths

 

that's javascript, you should have something similar in vbs

2 replies

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
December 10, 2020

pluginItems can be any number of objects ie tracing object, compound Shapes, paths from Photoshop, Envelopes, etc.

 

what kind of object is your plugin item? if it's a compound shape, you need to expand it to convert it to a compoundPath, then you can access it's path items.

 

to expand the compound Shape, make sure it's selected before running

app.executeMenuCommand ('expandStyle'); // convert to compound paths

 

that's javascript, you should have something similar in vbs

schroef
Inspiring
July 14, 2023

how can we find out by script what the pluginItems is. If it's build from pathItems from m pathfinder subtract using alt. It is still editable be t returns pluginItem for its typename

pixxxelschubser
Community Expert
Community Expert
December 9, 2020

 

@bruno5CDC  wrote:

 

… for example, 2 pathitems to create the Pluginitem


IMHO - 2 pathItems will give you a compoundPathItem