Adobe Photoshop Scripting giving error
Hi All,
I have written a script to automate the conversion of pdf files using Adobe photoshop. However, I am facing an issue while opening a pdf file with PDF Open options (highlighted in bold). I have tried using both vbscript and python. Please find below the error:
vbscript.vbs(39, 4) Adobe Photoshop: Illegal argument - argument 1 - File/Folder expected
Below is the part of the code where I am getting the error.
Private Function getPdfConv(ByVal ifilename, ByVal pdfcount, ByVal iFile)
Dim pdffolder, pdffolderpath, page,awayActiveDoc
pdffolderpath = ifilename
If Not oFso.FolderExists(pdffolderpath) Then
Set pdffolder = oFso.CreateFolder(pdffolderpath)
WScript.Echo("A new folder has been created at: " & pdffolderpath)
End If
For page=1 to pdfcount
pdfOpenOptionsRef.Page = page
'WScript.Echo("FileName: "&iFile)
if oFso.FileExists(iFile) Then
set docref = appRef.Open(iFile,pdfOpenOptionsRef) 'line 39
set awayActiveDoc = appRef.ActiveDocument
awayActiveDoc.ResizeCanvas 8.5,11
awayActiveDoc.SaveAs pdffolderpath, pdfSaveOptionsRef
awayActiveDoc.close
end if
Next
End Function
