Highlighted

Making custom Symbols available by default

Engaged ,
Nov 04, 2016

Copy link to clipboard

Copied

Since creating placed artwork from an external AI file has proved problematic, I decided to try using Symbols.

Does anyone know how to get symbols into Illustrator's default list, so that they are available to any document? I created my own symbol library, which I can load using the palette, but I can't seem to find a file that I can add my symbols so that they always just appear in the default list.

The "Unlisted" symbols feature also looks promising, since I don't really need the user to see these at all.

I'm not really sure how to go about this. Maybe someone has some experience adding and using custom symbols?

AIDocumentHandle handle = 0;

sPathStyle->ImportStyles(path, &handle);

ai::int32 count = 0;

sSymbol->CountSymbolPatternsFromDocument(&count, handle);

for (ai::int32 i = 0; i < count; i++) {

  AIPatternHandle symbol = 0;

  sSymbol->GetNthSymbolPatternFromDocument(i, &symbol, handle);

AIPatternHandle newStyle = 0;

  sSymbol->RetargetForCurrentDocument(symbol, &newStyle);

}

Topics

SDK

Views

951

Likes

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

Making custom Symbols available by default

Engaged ,
Nov 04, 2016

Copy link to clipboard

Copied

Since creating placed artwork from an external AI file has proved problematic, I decided to try using Symbols.

Does anyone know how to get symbols into Illustrator's default list, so that they are available to any document? I created my own symbol library, which I can load using the palette, but I can't seem to find a file that I can add my symbols so that they always just appear in the default list.

The "Unlisted" symbols feature also looks promising, since I don't really need the user to see these at all.

I'm not really sure how to go about this. Maybe someone has some experience adding and using custom symbols?

AIDocumentHandle handle = 0;

sPathStyle->ImportStyles(path, &handle);

ai::int32 count = 0;

sSymbol->CountSymbolPatternsFromDocument(&count, handle);

for (ai::int32 i = 0; i < count; i++) {

  AIPatternHandle symbol = 0;

  sSymbol->GetNthSymbolPatternFromDocument(i, &symbol, handle);

AIPatternHandle newStyle = 0;

  sSymbol->RetargetForCurrentDocument(symbol, &newStyle);

}

Topics

SDK

Views

952

Likes

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
Guide ,
Nov 04, 2016

Copy link to clipboard

Copied

AIDocumentHandle handle = 0;

sPathStyle->ImportStyles(path, &handle);

ai::int32 count = 0;

sSymbol->CountSymbolPatternsFromDocument(&count, handle);

for (ai::int32 i = 0; i < count; i++) {

  AIPatternHandle symbol = 0;

  sSymbol->GetNthSymbolPatternFromDocument(i, &symbol, handle);

AIPatternHandle newStyle = 0;

  sSymbol->RetargetForCurrentDocument(symbol, &newStyle);

}

Likes

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
Reply
Loading...
Engaged ,
Nov 04, 2016

Copy link to clipboard

Copied

Looks good. That's almost exactly what I came up with. Except I forgot about the "FromDocument" functions so I was flicking back and forth between them with Activate(..). And I open my source document with DocumentList->Open(...). Is there a reason you choose to create a new document with ImportStyles instead?

Likes

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
Reply
Loading...
Engaged ,
Nov 04, 2016

Copy link to clipboard

Copied

Weird. It looks like ImportStyles opens the document "silently" so it doesn't show in recent documents or flicker the display as it opens and closes. Very interesting.

Likes

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
Reply
Loading...
Guide ,
Nov 07, 2016

Copy link to clipboard

Copied

Yeah, I was going to write and tell you that That's not the only 'silent' document function. When you place art, at least for rasters, it also semi-silently does the same thing. I say 'semi-silently' because you get document opened notifiers and I had re-jig my code to ignore them if they didn't exist in the document list. That was a while ago though, so they may have fixed that; it felt like a bug.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 10, 2020

Copy link to clipboard

Copied

Old thread, but this is something I'm trying to do. I take it this uses Scriptographer. Is it compatible with AI CC 2015 and how do I run it? Do I need to install Scriptographer or is it simply a .JSX? Sorry, I'm clueless.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 11, 2020

Copy link to clipboard

Copied

Scriptographer is a plugin. It's compatible to versions up to CS5.

Into Scriptographer you can then plug scripts. But they won't run without Scriptographer as their base.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 15, 2020

Copy link to clipboard

Copied

So, for all practical purposes it is a "dead" program. I love CS5 but most customers/businesses do not even have it anymore. Thank you for clarifying.

Likes

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
Reply
Loading...