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

VB-Script: Creating artlayer for vector

New Here ,
Jan 01, 2021 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

Views

137

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
Adobe
Community Expert ,
Jan 01, 2021 Jan 01, 2021

Copy link to clipboard

Copied

LATEST

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

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