Clutch Cargo 0 Posted June 25, 2017 Report Share Posted June 25, 2017 I am trying to add some JS code inside my vbscript. I know literally nothing regarding JS so what I have researched I have come up with this but I get a "syntax error" at the 'Sub Trace()' line. Can anyone show me the proper way? Set App = CreateObject("Illustrator.Application") Set FSO = CreateObject("Scripting.FileSystemObject") Set SourceFolder = FSO.GetFolder("S:\SOCAL\Section_31\buildCOM TIFFs") Set TIFFfile = SourceFolder.Files 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 Call Trace() Sub Trace() <Script Language="JavaScript"> function traceRaster(){ var docRef = App.ActiveDocument; for(var a=0;a<docRef.placedItems.length;a++){ //this script implies the images are LINKED, not embedded. if you are working with embedded images, change 'placedItems' to 'rasterItems' var item = docRef.placedItems[a]; var traced = item.trace(); traced.tracing.tracingOptions.loadFromPreset("Land Cover"); //Change 'Line Art' or your preferred tracing preset if necessary } docRef.close(SaveOptions.SAVECHANGES); } </Script> End Sub Next Quote Link to post Share on other sites
justsomeguy 1,135 Posted June 26, 2017 Report Share Posted June 26, 2017 Those are 2 different languages, you can't mix them. They cannot share variables or anything like that. You're better off choosing a language and converting whatever code you need to convert to that language. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.