!!!No name problem!!!
Posted on 1998-10-14
Below is a vb function that works:
Private Sub RunPhotoshop()
' variable declaration
Dim App As Object
Dim photoDoc As Object
Dim filename As String
Dim Action As Object
'number of max parameters
Dim param(2) As String
'the current parameter number you're on
Dim paramCounter As Integer
'the number of times run through a loop
Dim loopCounter As Integer
'the character the loop is looking at
Dim currentCharacter As String
Dim parameters As String
Dim ReturnValue As Variant
Dim I As Variant
Dim strText As String
Set App = CreateObject("Photoshop.Application")
parameters = Command()
paramCounter = 1
For loopCounter = 1 To Len(parameters)
currentCharacter = Mid$(parameters, loopCounter, 1)
If currentCharacter = " " Then
paramCounter = paramCounter + 1
param(paramCounter) = param(paramCounter) & currentCharacter
Set photoDoc = App.Open(param(1))
The above function is part of an OLE Automation which processes an image file in Photoshop and saves it in a different filename.
The program works if I type something like this from the command prompt:
ole C:\Temp\image.eps export
where ole is the program, C:\Temp\image.eps is the image's path, and export is the Photoshop Action that processes the image.
BUT, if I do something like "ole image.eps export" or "ole \folder1\folder2\image.eps export", I get an error. So it works if I type the full path name but if I type a relative path name, it doesn't work.
Anyone knows how to fix this?