• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

vbscript trace raster to vector

Participant ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

While researching, I came across this older thread Raster to vector ,  which looks like what I might need exactly.   However it is in JavaScript and I need it in VBscript.  If the original author, williamdowling, happens to see this thread (or anyone else),  would you be able to create the same code in vbs?  Here is what you wrote back then:

  1. function traceRaster(){ 
  2. var docRef = app.activeDocument; 
  3. 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' 
  4. var item = docRef.placedItems
  5. var traced = item.trace(); 
  6.        traced.tracing.tracingOptions.loadFromPreset('Line Art'); //Change 'Line Art' to your preferred tracing preset if necessary 
  7.   } 
  8.   docRef.close(SaveOptions.SAVECHANGES); 
  9. }

Thank you for your time.

TOPICS
Scripting

Views

496

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Hey, clutch-cargo​,

Wow.. i had forgotten all about writing this. Unfortunately, I don't know the first thing about VBS as i'm a lifelong mac user. May i ask why JS won't work for you? JS works cross platform so there shouldn't be any compatibility issues...

-William

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 20, 2017 Jun 20, 2017

Copy link to clipboard

Copied

Ah rats! Thought this might be my lucky day

Fairly embedded with vbscript for the work and tools I use so learning JS is not an easy option.

Let me ask you this if you might know...I have noticed in some AI vbscript examples that they use the statement 'appRef.DoJavaScript'.  Would that mean there is a way to have my vbscript run parts of in in JS?  If so, do you know how?

thx.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2017 Jun 20, 2017

Copy link to clipboard

Copied

Sorry. I literally don't know a single thing about vbscript. I've never written a single line of vbscript so i'm not familiar at all with the API. Adobe does provide documentation for API's for each of the 3 supported languages (JS, AppleScript, and vbScript). Perhaps you can find what you're looking for there.. I'd share the link but I think there's a firewall conflict on my work network for some reason. Just do a google search for "Adobe Illustrator vbscript scripting reference" and you'll find a page that has documentation for every version of illustrator.

Sorry i can't be of more help. =(

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 22, 2017 Jun 22, 2017

Copy link to clipboard

Copied

No problem.  Been through those guides and they have been helpful but sadly not a single example on custom traces, presets, graphic styles for vbscript.  Hopefully some vbs guru will come across this and lead me in the right direction.  But I will keep hammering away.

Thx again

Clutch

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 22, 2017 Jun 22, 2017

Copy link to clipboard

Copied

Yea sometimes you can use VB or AS do javascript methods to run javascripts in Illustrator from the original language.

Mainly, the js is sent through as a string.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 22, 2017 Jun 22, 2017

Copy link to clipboard

Copied

So Silly-V

Are you saying I would do entire script lines above 1 thru 9 as a string?  This will be my next attempt.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jun 22, 2017 Jun 22, 2017

Copy link to clipboard

Copied

LATEST

Yes, try it. I would first try with a simple alert box though.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines