Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate PhotoShop 5.5

Status
Not open for further replies.

JustinEzequiel

Programmer
Jul 30, 2001
1,192
PH
Can anybody point me to articles re automating PhotoShop 5.5? Sample code would be welcome.
I need to convert images to EPS, JPEG, CCITT4, etc.
Below is the best that I could do.
As you can see, I had to assume that the images have the correct extension as I could only use 'Open' and not
'Open As'.
I recorded two actions in Photoshop as I could not find a
'Save As' method.
In addition, I could not find a way to get the image information (dimensions, bits/pixel, DPI, etc.)
Can Illustrator be automated similarly?

Public Function PhotoDocCreated(ByVal sSource As String, _
ByVal nActionIndex As Integer) As Boolean
' assume sSource is with correct extension (.tif for TIFF, .jpg for JPEG, etc.)
' will create EPS or JPG file with extension .eps or .jpg in same folder as sSource
' nActionIndex = 1 ' SaveAsEps
' nActionIndex = 2 ' SaveAsJpg

Dim oPhoto As PhotoshopTypeLibrary.PhotoshopApplication
Dim oPhotoDoc As IAutoPSDoc

On Error GoTo ERRORHANDLER

PhotoDocCreated = False

Set oPhoto = New PhotoshopTypeLibrary.PhotoshopApplication
Set oPhotoDoc = oPhoto_Open(sSource)
oPhoto.Actions(nActionIndex).Play
oPhotoDoc.Close
Set oPhotoDoc = Nothing
oPhoto.Quit
Set oPhoto = Nothing

PhotoDocCreated = True
Exit Function

ERRORHANDLER:
msProblem = Err.Description
PhotoDocCreated = False
End Function
 
what about looking at the adobe web site?
start here - download the sdk kit, it contains code samples
well, there's something you should know - the link was pointing at a file located in another directory on adobe ftp server, you'll have to search the directory structure for that file, if the link is not already repaired :)
 
Thanks. Have downloaded SDK. Hope samples work with PhotoShop 5.5 as I don't have version 6.0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top