Setting up OLE automation problem

can'it get the OLE thing working.
this is my Maxscrpt.reg file

; 1. Change the path in the last line of this file to point at your
; current 3ds Max executable directory, then
; 2. Double click this file in Windows Explorer
; registration info MAX.Application (defaults to MAX.Application.12)
HKEY_CLASSES_ROOT\MAX.Application = OLE Automation MAX Application
HKEY_CLASSES_ROOT\MAX.Application\Clsid = {7FA22CB1-D26F-11d0-B260-00A0240CEEA3}
HKEY_CLASSES_ROOT\MAX.Application\CurVer = MAX.Application.12
;; registration info MAX 12.0
; (Application Object)
HKEY_CLASSES_ROOT\MAX.Application.12 = OLE Automation MAX 12.0 Application
HKEY_CLASSES_ROOT\MAX.Application.12\Clsid = {7FA22CB1-D26F-11d0-B260-00A0240CEEA3}
HKEY_CLASSES_ROOT\CLSID\{7FA22CB1-D26F-11d0-B260-00A0240CEEA3} = OLE Automation MAX 12.0 Application
HKEY_CLASSES_ROOT\CLSID\{7FA22CB1-D26F-11d0-B260-00A0240CEEA3}\ProgID = MAX.Application.12
HKEY_CLASSES_ROOT\CLSID\{7FA22CB1-D26F-11d0-B260-00A0240CEEA3}\VersionIndependentProgID = MAX.Application
HKEY_CLASSES_ROOT\CLSID\{7FA22CB1-D26F-11d0-B260-00A0240CEEA3}\LocalServer32 = C:\Program Files\Autodesk\3ds Max 2012\3dsmax.exe

I double click it, still no problem. but i can't create an OLEObject

-- Runtime error: createOLEObject: can't create instance Photoshop.Application

Am I doing something wrong?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

2012 = 14

Your reg file is almost fine, but version number of Max 2012 is 14, not 12 (2008 = 10, 2009 = 11, 2010 = 12, 2011 = 13).

my recent MAXScripts RSS (archive here)

jos's picture

still error

Thanx. I changed the reg file, but still I can't create an OLEObject..
file in attachment, had to change the extention to upload.

maxscrpt.txt 1.32 KB
Anubis's picture

hmm, more details then

tell me more details:
* Windows bit version (32 or 64)
* Photoshop bit version (32 or 64 or both)
* and Max bit version (32 or 64 or both)

my recent MAXScripts RSS (archive here)

jos's picture

all 64 bit versions

thanx for helping me. first time trying the OLE thing..
all 64 bit version, photoshop both

Anubis's picture


well, i cant help directly w/o Max2012 on hand, but other thought in my mind is to test Photoshop outside of Max, just to isolate the issue. if PS executed fine by script (JavaScript or VBScript) then most likely this is a new bug in Max2012.
to test PS - variant #1 (using VBScript):

Dim appRef
Set appRef = CreateObject("Photoshop.Application")
Set appRef = Nothing

save above in "test.vbs" and double-click on the file;
or variant #2 (using JavaScript):
var app = new ActiveXObject("Photoshop.Application");
save above in "test.js" and double-click on the file;

my recent MAXScripts RSS (archive here)

jos's picture

errors too

Hmm I get an error when running your first variant.
"Error: ActiveX component can't create object: 'Photoshop.Application'
Code: 800A01AD
Source: Microsoft VBScript runtime error"
seems the problem is photoshop or windows then.. This is new for me so i really don't know how to solve this

when double-clicking the javascript file I get a popup with :
"This file does not have a progra associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel."
wich program should this be?

thanx for helping me

Anubis's picture

win registry

yeah, maybe reinstalling Photoshop will fix the mess, but really odd why JS files are not registered as executable? The WSH (Windows Scripting Host) is a part of Window from Win95, and it run JavaScripts (.JS) + VBScripts (.vbs), so maybe the mess is much biger...

forget to say where to search for WSH engine - it s'd by at "WINDOWS\System32" folder, but if the .VBS executes fine, you can get the path with VB like:
WScript.Echo (WScript.Path)
and there s'd be 2 EXEs:

WScript.exe -- shell host executor
CScript.exe -- command-line engine

in my pc C is the system drive, so quick test whether this files exist using the console is - StartMenu > Run > CMD, then in the console:

CD C:\WINDOWS\System32
DIR cs*.exe
DIR ws*.exe

my recent MAXScripts RSS (archive here)

jos's picture

it works with excel..

Thanx again. I found those exe's. I linked js fie to wcript.exe and i can execute the js file. but i get an error to "automation server can't create object" i took a printscreen from my cmd window:

so the javascript thing is solved, but what should I do for photoshop? (I tried it with illustrator to, didn't work)

but interesting: with excel it works. No errors when running the vbs file. + in maxscript it works too, so the problem is not max?



Anubis's picture

reisntall photoshop?

max is not the bad boy then.
did you reinstall photoshop?

my recent MAXScripts RSS (archive here)

jos's picture

no time at this moment

no can't reinstall photoshop at this moment (i'm in the middle of my exams and after got week off. I have to activate via school). So this will have to wait for a moment, but i'll be back on it asap

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.