VB-Script: Creating artlayer for vector

New Here ,
Jan 01, 2021

Copy link to clipboard

Copied

Hello alls,

 

I've got a small problem in coding:

I have created a path "by hand", and now I want to create a artlayer to include the path in it.

(to be able to export it as *.svg later on).

"By hand": select path => create Layer => and in Drawing environment (? German: Freiform-Zeichenstift) clicking on "Form" in top lane => a form layer is created, the path within => ready to export...).

 

Taking a look into the object of this artlayer it is of kind "psSolidFillLayer".

 

Now my sample code (executing from Excel VBA):

Dim appRef
Set appRef = CreateObject("Photoshop.Application")
Set myDocument = appRef.ActiveDocument
Set newLayer = myDocument.ArtLayers.Add

'path has been created by hand and is selected
newLayer.Kind = psSolidFillLayer 'is NOT working => runtime error
newLayer.Kind = psTextLayer 'is working
newLayer.Kind = psNormalLayer 'is working

 

=> with this code I can switch the artlayer to Text-Layer and back to Normal-Layer.

But every time I try to switch it to "psSolidFillLayer", there is a runtime error...

 

Can anybody support me, how I have to adapt my code to make it work?

 

Thanks a lot

and best regards

Manuel

 

TOPICS
Actions and scripting, How to

Views

21

Likes

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

VB-Script: Creating artlayer for vector

New Here ,
Jan 01, 2021

Copy link to clipboard

Copied

Hello alls,

 

I've got a small problem in coding:

I have created a path "by hand", and now I want to create a artlayer to include the path in it.

(to be able to export it as *.svg later on).

"By hand": select path => create Layer => and in Drawing environment (? German: Freiform-Zeichenstift) clicking on "Form" in top lane => a form layer is created, the path within => ready to export...).

 

Taking a look into the object of this artlayer it is of kind "psSolidFillLayer".

 

Now my sample code (executing from Excel VBA):

Dim appRef
Set appRef = CreateObject("Photoshop.Application")
Set myDocument = appRef.ActiveDocument
Set newLayer = myDocument.ArtLayers.Add

'path has been created by hand and is selected
newLayer.Kind = psSolidFillLayer 'is NOT working => runtime error
newLayer.Kind = psTextLayer 'is working
newLayer.Kind = psNormalLayer 'is working

 

=> with this code I can switch the artlayer to Text-Layer and back to Normal-Layer.

But every time I try to switch it to "psSolidFillLayer", there is a runtime error...

 

Can anybody support me, how I have to adapt my code to make it work?

 

Thanks a lot

and best regards

Manuel

 

TOPICS
Actions and scripting, How to

Views

22

Likes

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
Jan 01, 2021 0
JJMack LATEST
Most Valuable Participant ,
Jan 01, 2021

Copy link to clipboard

Copied

Perhaps you should try using Action Manager Code to define Custom Shaped and Add solid full and shape layers if VSB code has issues making ArtLayers it add  LayerKind solid fill. Adobe's Plug-in Scriptlistener records both JavaScript Code and VBS code. Photoshop JavaScripts often have to use Action manager code for Adobe JavaScript DOM does not cover all of Photoshop features.

JJMack

Likes

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
Reply
Loading...
Jan 01, 2021 0