Copy link to clipboard
Copied
Hello,
I am trying to automate some work via scripting. So first i add the Interop.Illustrator.dll assembly to my VB.Net project.
Next i want to start illustrator visible and do my scripting. That scripting code is ready and working.
But whenever i try to create an instance of illustrator via:
AIappli = New Illustrator.Application
or
AIappli = CreateObject("Illustrator.Application")
or
AIappli = CreateObject("Illustrator.Application.CS5")
or
AIappli = CreateObject("Illustrator.Application.CS6")
I get randomly errors like "Cannot create axtivex component" or server timeout/fault/not avilable errors.......
This is very random so sometimes the above code is working, but sometimes it doesn't'!
The installation we are working on is a CS6 suit upgraded from CS5 suite.
When i go to the HKCR\CSID registry to search the progid i found:

So i do not understand what i am doing wrong here??
Any help on this?
Thanks.
try it like this
set AIappli = CreateObject("Illustrator.Application")
Copy link to clipboard
Copied
try it like this
set AIappli = CreateObject("Illustrator.Application")
Copy link to clipboard
Copied
Thank you, i have just another question.
How can i access something with the index number?
For example the second document.
If i look at the functions, i only see you can access it by itemkey eg. a string value eg. the document name
Is this possible by index(as integer) For example
AIappli.Documents.Item(1)
instead of
AIappli.Documents.Item("second")
Copy link to clipboard
Copied
you're welcome, you can use both, index or name
second document, indexes are 1 based
AIappli.Documents(2)or, if the doc's name is "second"
AIappli.Documents("second.ai")
Copy link to clipboard
Copied
Hello,
This does not work.
I am converting the following article to vbscript:
http://forums.adobe.com/message/4173641
And i am stuck in the method "unlockHideLayers". If i do "doc.layers(i)" the program gives me "Illegal Argument" exception..
EDIT: OK nevermind, 1 based index as you described.
Copy link to clipboard
Copied
OK, have a problem with the moveObjects method. Note: i am converting the script to vbscript
so i do:
dim sel
sel = currDoc.selection
moveObjects sel, appRef.Documents("tmpPortfolio")
Sub moveObjects(sel, destDoc)
for i = 1 to sel.length
sel(i).duplicate destDoc.Layers(sel(i).layer.name), "ElementPlacement.PLACEATEND"
next
End Sub
But the error message i am getting is: "object required 'sel'"
Any help please? Thank you
Copy link to clipboard
Copied
But the error message i am getting is: "object required 'sel'"
is that the whole script?
currDoc is not set, as well as appRef, etc.
if you have other questions, please start a new thread, this one is getting out of topic.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now