akash sharma February 2016

Photoshop Automation

I want to run photoshop action through Visual basic UI. i mean if user click on button then photoshop action should run.

can anybody give any hint on that? thank you

Public Class Form1
    Dim appRef
    Dim app
    Dim File
    Dim JavaScriptFile
    Dim nums(2)
    Dim argsArr()
    Dim photoshopApp As Photoshop.Application
    Dim photoshopDoc As Photoshop.Document
    Dim curLayer As Photoshop.ArtLayer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        appRef = CreateObject("Photoshop.Application")
        app.load(File("C:\Border-2.atn"))
        app.DoAction(ThisQueue.Dequeue)
    End Sub

Answers


Goldmoon February 2016

You have to load your Actions or Actionsets within Photoshop first! You can't load or invoke Actions as you've tried it. "App.load (File (..." refers to load images.

   Private Sub PhotoshopDoAction(ByVal action As String, ByVal actionSet As String)
        Dim PS As Photoshop.Application

        PS = New Photoshop.Application
        If PS.Application.Documents.Count > 0 Then
            PS.DoAction(action, actionSet)

        End If

    End Sub

Post Status

Asked in February 2016
Viewed 1,404 times
Voted 5
Answered 1 times

Search




Leave an answer