I've been running a suite of VBScripts with Photoshop CS5.1 for years but recently replaced my motherboard and I'm having a problem getting my scripts going again after rebuilding the machine.
To isolate the problem, I've been trying the following test script taken from the Photoshop CS5.1 scripting guide:
1> Dim appRef, docRef, jpgSaveOptions
2>
3> Set appRef = CreateObject("Photoshop.Application")
4> Set docRef = appRef.Documents.Add()
5>
6> Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions")
7>
8> jpgSaveOptions.EmbedColorProfile = True
9> jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline
10> jpgSaveOptions.Matte = 1 'for psNoMatte
11> ...
As it's 32bit I run it using c:\SysWoW64\cscript.exe
After the clean install of Windows 10 this wouldn't work (as expected) with an ActiveX Can't create object error, so I started the ActiveX Installer (AxInstSV) service and set its startup type to automatic and rebooted the machine.
The test script now runs, opens Photoshop OK and opens a new document but then fails when it gets to JPEG save options with:
test.vbs(6, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'Photoshop.JPEGSaveOptions'
So it can create the Photoshop.Application object but not the Photoshop.JPEGSaveOptions object. Does anyone have any ideas why that might be?!
To isolate the problem, I've been trying the following test script taken from the Photoshop CS5.1 scripting guide:
1> Dim appRef, docRef, jpgSaveOptions
2>
3> Set appRef = CreateObject("Photoshop.Application")
4> Set docRef = appRef.Documents.Add()
5>
6> Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions")
7>
8> jpgSaveOptions.EmbedColorProfile = True
9> jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline
10> jpgSaveOptions.Matte = 1 'for psNoMatte
11> ...
As it's 32bit I run it using c:\SysWoW64\cscript.exe
After the clean install of Windows 10 this wouldn't work (as expected) with an ActiveX Can't create object error, so I started the ActiveX Installer (AxInstSV) service and set its startup type to automatic and rebooted the machine.
The test script now runs, opens Photoshop OK and opens a new document but then fails when it gets to JPEG save options with:
test.vbs(6, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'Photoshop.JPEGSaveOptions'
So it can create the Photoshop.Application object but not the Photoshop.JPEGSaveOptions object. Does anyone have any ideas why that might be?!