Jump to content

Need help with vbscript and Adobe Illustrator preset

Recommended Posts

Hey there... my first post. :)

Over the months I think I have become a fairly good beginner with vbscript and have even interfaced with Photoshop and Illustrator but this one has stumped me for weeks.  If you are familiar with Illustrator I am trying to take a Tiff image and trace it with a custom trace I have created.  So if you are interested in vbscript and Illustrator I could really use a second pair of eyes.  Apparently, it can be done. I have API documentation, Java and VBA examples but this is over my head.
Any takers?

Here is what I have so far (one of many renditions):

Set App = CreateObject("Illustrator.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set SourceFolder = FSO.GetFolder("S:\SOCAL\Section_31\Land Cover")

Dim FileRef
For Each FileRef In SourceFolder.Files
    Set AutoCADOpenOptions = App.Preferences.AutoCADFileOptions
        AutoCADOpenOptions.MergeLayers = false
        CurrentInteractionLevel = App.UserInteractionLevel
        App.UserInteractionLevel = -1 ' aiDontDisplayAlerts
        Set myDoc = App.Open(FileRef.Path,2)
        App.UserInteractionLevel = CurrentInteractionLevel
        ' The line below loads tiff file into Illustrator ready for a custom trace
        App.DoScript "LandCover-1", "Land Cover Auto"
        ' From thi point on I am having no success. Need help building this out.
        Dim idoc    : idoc    = App.ActiveLayer
        Dim iplaced : iplaced = App.PlacedItem
        Dim itraced : itraced = App.ActiveLayer
        Dim iFile   : iFile   = FileRef.PlacedItems.Trace

Link to post
Share on other sites

I'm not sure what your question is, but it looks like you're trying to use a variable called tracingPresets that isn't defined.  I'm not sure if your syntax for defining those variables is correct either.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...