Swatch Programming

I have written an file format plug-in for custom files produced by a bespoke design package. This works fine but find I just can't add, change, delete or in any other way affect the document swatch. I want to delete the current colours and add my own colours which are contained in my custom file (Colours and descripions). I've tried everything but it seems like the swatch isn't loaded or something similar when my file imports - but I'm probably missing something obvious!
Can someone please tell me how to load a set of colours into the swatch when I load my custom file and/or provide some sample code.
I'm using Illustrator CS2 with Windows XP...and MS Visual Studio 2005
Thanks in anticipation!

Just started w/ CS3 SDK (beta) This is just test code but it does seem to work.
// these look like the working color space selection profiles
AIColorProfile rgb, cmyk, gray;
Error = sAIDocument->GetDocumentProfiles(&rgb, &cmyk, &gray);
// only one is valid
ai::UnicodeString name;
if (rgb)
Error = sAIOverrideColorConversion->GetProfileName(rgb, name);
else if (cmyk)
Error = sAIOverrideColorConversion->GetProfileName(cmyk, name);
else
Error = sAIOverrideColorConversion->GetProfileName(gray, name);
string s = name.as_Roman();
short colorModel;
Error = sAIDocument->GetDocumentColorModel(&colorModel);
// attempt to find a color in the swatch palette and if I find it get it's color values
ai::UnicodeString colorName("Atomic Red GCS-293");
AICustomColorHandle colorHandle;
AICustomColor color;
// find our color name in the doc's swatch
Error = sCustomColor->GetCustomColorByName(colorName, &colorHandle);
if (Error == 0)
// found it, get it's color
Error = sCustomColor->GetCustomColor(colorHandle, &color);
else
// din't not find it, create a color
color.c.rgb.red = 0.7685;
color.c.rgb.green = 0.051;
color.c.rgb.blue = 0.051;
color.flag = kCustomSpotColor;
color.kind = kCustomThreeColor;
Error = sCustomColor->NewCustomColor(&color, colorName, &colorHandle);
AIDocumentHandle document = NULL;
Error = sAIDocument->GetDocument(&document);
AISwatchListRef swatchList;
Error = sSwatchList->GetSwatchList(document, &swatchList);
AISwatchRef swatch = NULL;
swatch = sSwatchList->GetSwatchByName(swatchList, colorName);
if ( !swatch )
swatch = sSwatchList->InsertNthSwatch(swatchList, -1);
if ( swatch )
Error = sSwatchList->SetSwatchName(swatch, colorName);
int cCount;
AIColor aiColor;
aiColor.kind = kCustomColor;
aiColor.c.c.tint = 0.0f;
aiColor.c.c.color = colorHandle;
Error = sSwatchList->SetAIColor(swatch, &aiColor);
cCount = sSwatchList->CountSwatches(swatchList);
cCount++;
Hope this helps

Similar Messages

  • "Could not complete your request because of a program error" when clicking on swatches.

    Whenever I try to click on swatches I get this error. I am using Photoshop CC.

    Whenever I try to click on swatches I get this error. I am using Photoshop CC.

  • Color picker does not work, " program error when I click, photoshop cc

    I am user of photoshiop cc and it worked fine until several days ago but suddenly it shows " program error " when I click color picker, and I can not use changing color. Please help me to resolve this issue.

    There was a bug with photoshop CC concerning the color picker and its swatches. Make sure you have the latest version and then if it still exists, reset your tools in the upper left hand corner which would be the very first icon in the top tool bar. That should fix it. If not let us know and maybe someone can think of something else.

  • Can not find pantone+ swatches in InDesign CS6, such as 2239c?

    How do I find the pantone+ swatches in InDesign CS6, such as 2239c? It is not visible in the swatches panel? Can anyone else see this swatch in Indesign Cs6 or Illustrator Cs6?

    From the Swatches panel Flyout menu, choose New swatch.
    In the new swatch definition dialog, under Type choose Spot, and under Mode choose Pantone + Solid Coated.
    There are some legacy colors that are not included inthe Pantone + series. You can add these to both ID and Illustrator by following the directions in Pantone Plus color libraries (Thanks, Vikrant ).
    2239 isn't in my old swatchbooks as a spot color or the legacy books for the program, either. Are you sure that's a vaild number? Perhaps youpi really mean 223-9, a light blue-gray process color? If that's the case, you'd need to specify Process instead of Spot, and choose the appropriate book fromthe mode dropdown. The 223 series seems not be included in the + books, but it is inthe legacy books if you add them according to the instuctions in the link above.

  • 7. Re: What is the location for the swatches file in the illustrator product part of Adobe Creative Suite 3 Design Premium for windows (date and lenght)? File that manges its funcionallity.  Thanks

    Original posting: https://forums.adobe.com/message/6529108#6529108
    As per support suggestion:  The discussion is posting again to obtain answer from adobe staff
    ===
    Illustrator is not working as it should...
    I want them to compare the original size and date of creation with what I have installed on my computer... I have installed several times with my original CD and I tried once downloading the files from the adobe site (using my own license). I suspect the files has been modified or renamed on my laptop by an external unauthorized user causing the malfunction of the application.
    Customer services does not support CS3 anymore and the updates / patches in the adobe site does not solve the problem... They redirect me to the forums for support...
    Presently, my problem is that after creating a swatch and drag it to the swatch panel, it does not fill as it should a new form... Now, after deactivating and activating my license the swatch seems to fill the new form but when the filter that the swatch has is persistence in the next filling object created even though a different color is being used as a fill (X)... Help in the creation of a swatch over the internet just complicate the issue.
    That's why I would like to know whether updates on my product are being received or files are being replaced without my knowledge...
    Thanks...
    PS Do you know how to contact a staff adobe employer on the forums?

    I saw your post today. 
    Moving the hosts file to the desktop will make it part of a roaming profile?  That's means that activation will occur from any computer that are part and available of my microsoft local network.  How can I make sure that the program I access is the one located on my local C drive and not in a roaming profile in maybe a cloud environment or from an unknown equipment with access to my network without authorization. I have only 1 laptop where I install locally the CS3 suit
    My host file has not entries on it and even when trying to copy to the desktop the activation can not be completed, same problem.  Days ago I used the trial option instead of the activation, after trying to activate the whole product as you mentioned in your reply, the trial period remaining got back to the original 30 days.
    I have recently noticed that I have a roaming profile with a workspace file different to the one I have on my local disk (3 files basic, panel and type).  On the roaming profile I see a directory for adobe illustrator CS3 settings \ workspaces \ AIWSPrefs file which has different entries than the one I have at the local drive.  Normally I do not customize a lot the workspace or safe the setting used, I load the brushes, swatches, etc manually from the location they are on my local drive so the swatches and brushes directories on the roaming profile are empty instead. Adobe Eureka and Kuler palettes exists on the basic local file not in the roaming one.
    The directories on my roaming profile are:
    Acrobat
    Adobe Illustrator CS3 Settings
    Adobe PDF
    Adobe Photoshop CS3
    Color
    Dreamweaver 9
    Flash Player
    Fonts
    Headlights
    Linguistics
    Logs
    LogTransport2
    Save For Web AI
    Updater5
    Workflow
    XMP
    Inside illustrator roaming directory, the following files :
    AI Color Settings
    AIAppResources
    AIMenuFaceCache
    AIPrefs
    Brushes
    Composite Fonts
    Graphic Styles
    IllustratorFnt.lst
    Kinsoku
    MojiKumi
    New Document Profiles
    Plug-in Cache.ARTX
    Plug-ins
    Print Presets
    Save for Web Settings
    Swatches
    Symbols
    Transparency Flattener Presets
    Workspaces
    In the above scenario, which workspace and other functions files will take precedence?  How can I avoid the roaming profile?
    Not being able to copy files from the roaming profile to my local disk, I wondering how this roaming profile was created and why the files are in there.   Those files have a date from last month, the local files were more recently installed.
    Your comments will be appreciated at your earliest.
    Thanks in advance

  • Custom color-palette keeps becoming read-only and will not let me add new swatches

    I need to make a custom colour palette for work that i can open on different adobe programs, share with others and add new swatches to as I go. I create a custom palette, save it a custom name but whenever I re-open it, it has become a read-only palette and I can no longer add custom swatches to it. How do I get around this problem if I need to keep adding colours to my custom palettes?
    Thanks

    In case you need to keep swatches from the ASE:
    create a new document
    empty the swatches panel
    add all the swatches from the ASE into that document's swatches panel
    add new colors as swatches
    from the swatches panel's menu select "save library"
    Also see the manual on creating swatches.

  • Custom Swatch Panel Closes on Launch CS5.1

    I've been experiencing a frustrating, bizarre situation recently. I have a Persistent custom swatch library load for an instant upon startup, then within a second it closes itself. I have to open the Swatches panel manually, then my custom library loads again *but* also opens the Links panel. I have ensured that my custom library is saved in the correct location (/Program Files/Adobe/Adobe Illustrator CS 5.1/Presets/en_us/Swatches), and confirmed that 'Persistent' is checked in that custom library. I even tried saving my workspace as a different name.
    This is an annoyance more than anything else. I've tried deleting my preferences but I'm still getting no love.
    Any ideas? Thank you for reading, and in advance for any assistance.

    We don't have any way to extend the trial.  It is possible you may have other software installed which has interferred with the trial process.  Which operating system are you using btw?  Did you receive any error messages during the install process?

  • Swatch palette extends off screen

    This afternoon, I opened a Pantone swatch palette, and when I clicked the resize handle, a glitch in my Apple mouse made the cursor jump down off the bottom of the screen, taking the bounding box for the palette with it. I can't scroll, or reach the resize handle, which is now below the confines of the screen. The box will not move higher than the Apple task bar, and there seems no way to fix the box back to its original size.
    Restarting the program did not work, and restarting the computer did not solve the problem either. The box remains "hyperextended."
    Does anyone have tips or advice on restoring the palette size to its original settings?

    Reset the AI preferences hold the command Option Shift key down while launching  Illustrator or
    1. Quit Illustrator.
    2.Go to User/username/Library/Preferences/ Adobe illustrator CS4 Settings and trash the settings folder, the whole folder not just the contents of the folder..
    3. Start Illustrator. Illustrator creates a new preferences file.

  • InDesign CS3 Swatch Palette Problem

    Hi,
    I have an issue in InDesign where the "Pantone Solid Coated" library is covering any other colour book I am trying to work with, including CMYK etc. Also I have to change a colour from Process to Spot and then back to Process again to be able to name it. I havd to re-install the Creative Suite on a different computer to the one I used before, and that's when this started. I am using CS3 Design Standard on an Intel Mac 10.4.11
    If anyone has a solution, please do let me know as i have to use the programs more than 8 hours a day!
    See attached screenshot below.
    Thanks!!

    Hi Peter,
    I did, but when I put them back I had the same swatch problem again, so will
    have to re-save the settings I'm afraid.
    Thanks!
    Make copies of the files listed inthe link and store them in a safe place.
    Next time you can just copy the backups into the real locations and you won't
    need to rebuild anything.
    >

  • InDesign CC swatch palette issues when creating a new color or updating a current color...

    InDesign CC has crashed on me three times in a row and still won't fix it's problem...EVEN AFTER my computer and all the programs were shut down overnight! I was in the swatch palette to create a new swatch. I had a current one selected to base the new one off of. I went under "create new swatch," the palette came up, my mouse auto-scrolled when I clicked and it landed on "DIC color." Now, the DIC fields won't disappear even when I'm in CMYK or RGB. And when I try to change it to CMYK or RGB or the color values, it crashes InDesign. When I load it back up, the problem still exists. How do I reset it???

    THANK YOU! It worked exactly for what I needed it to fix. I have been out of the Graphic Design game for a couple years and forgot a lot of quick fixes. I really appreciate it!

  • Pasting text from a word program while retaining the same italics formatting?

    Hello,
    I'm looking for a way to be able to copy text from another program (Microsoft Word) and then, using the Text tool in Photoshop (CS6), paste that text, but where it retains the correct italics formatting I had in the other program--and not as an image of text (Ctrl+P), in which the formatting is present, as a flat image, but rather as an actual unrasterized and editable Text layer. For example, the sentence “I told you..” where 'told' is italics, simply pastes into Photoshop as "I told you.." without the original formatting. Is there a way to get Photoshop to recognize formatting from pastes without my having to manually re-apply the formatting myself? This would be a hassle over a long period of time. If necesary I would be willing to use a plug-in that allows for this sort of recognition.
    Thanks!

    InDesign does correctly accept Word's formatting with 2 important considerations.
    In the InDesign preferences, Clipboard Handling needs to be set up to paste "All Information (Index Markers, Swatches, Styles, etc)
    In Word you can't use formatting like faux Bold or faux Italic in place of using a font that has an actual Bold or Italic font style.
    InDesign only allows for using fonts that have a Bold or Italic font style and no longer allows for faux styles like MS Word or older type layout applications like PageMaker or Quark (clicking a B or I button)
    You can copy the Text Block in InDesign (the arrow tool - not the text tool) and paste this into Photoshop as a Vector Smart Object.
    You can then use a layer style on this Vector Smart Object layer.
    But all this really just a sideshow. If you are copying a small amount of text, it shouldn't take long to reformat in PS.
    If you are doing a large amount of text or small amounts many, many times you should do as Willi Adelberger says and place the images in InDesign. You can place or paste text for MS Word in InDesign  (and adjust or edit it if you want)
    In InDesign you can color the text, apply special effects like drop shadows, embossing, etc.
    Can you tell us the amount of text you deal with, how often you need to do this, and what (if anything) do you want to do to the text after you get it into PS?
    I think everyone would agree with Willi's statement: "Personally I would avoid to make text objects in Photoshop if not specific raster-image effects or combinations are needed."

  • Can InDesign CS6 handle pattern swatches?

    I layout catalogs and production materials for a pajama company, and I use pattern swatches extensively to depict our pajama prints on illustrated garment blanks.  I'm currently using CS3 (and trying to convince my boss to upgrade), and I have to do all my layout in Illlustrator because InDesign can't do anything with the pattern swatches.  I know I can import objects that have a pattern swatch applied, and, while it looks pixellated, prints correctly.  But where I can't alter them or re-apply the swatch or anything, it's too much of a hassle in going back and forth between the programs.  So much so, that I haven't been using InDesign at all. 
    I'm fine with creating the swatches in Illustrator, but I need to be able to create a pattern swatch pallette for InDesign or something. Anything.

    There are definitely some things which Illustrator is better at doing. Pattern swatches is one of them. In fact, Illustrator CS6 has a much improved method for creating pattern swatches.
    See this Adobe TV video:
    http://tv.adobe.com/watch/adobe-design-center/adobe-illustrator-cs6-sneak-peek-pattern-cre ation/

  • CS6+   executeMenuCommand, pattern swatch

    Hi all, I'm trying to create a Pattern Swatch out of the Selected Object, so I'm using
    app.executeMenuCommand ('Define Pattern Menu Item');
    this successfully adds the swatch to the swatches panel, but it also brings up the Pattern Options Panel and goes into "Pattern Editing Mode" where in the UI one could either click on "Cancel", "Done" or "Exit Editing Mode" buttons...
    the problem is I can't exit out of the Pattern Editing Mode, has anyone discovered if there is a MenuCommand for it?
    thanks

    And prob not reliable enough in that case as you have no control over a clients computer.
    would need many safe guards to make sure the ESC was only pushed if illustrator window active. in case another program takes focus in that split second... etc.
    as far as I know AHK is PC only, there are other alternatives but would be different scripting language.
    1 of the best scripts I have written with AHK changes the default program for pdfs from illustrator to acrobat and back. modifying the registry directly.
    this allows me to open pdfs straight from outlook into ether program without saving file first. as outlook has no open with dialogue.
    I also have another one ( not written by me ) called FixZoomBug. this allows the ALT+mouseWheel to zoom in illustrator without the file menus activating. I could not do without this...

  • Illustrator - Pattern Swatch / Clipping mask issue

    I'm currently working in Illustrator CS6. I'm creating pattern swatches and have successfully created 20 - but 4 are giving me the following issue.
    When I drag the perfect swatch tile into swatches it appears as so instead of the perfect tile:
    "New pattern swatch 3" has a white space on the right. Which sometimes when I create the swatch takes up half of the 'swatch.'
    When I go to create a shape and apply the pattern, I am left with an empty box.
    When I double click to adjust the pattern I get this dialog box:
    When I go to adjust the bounding box, to see where my pattern is - this crazy mess happens:
    Further investigation and deleting items to see whats happening:
    Bits of my pattern appear, but not sure why the other bars are there.
    I'm having this issue with four very different patterns. But I have also succesfully created more complicated ones. Not sure why this is happening.
    Any help is greatly appreciated!

    Hey everyone,
    I am in the same version, same file. I have also tried starting from scratch in another file just to make sure. Same issue.
    I have templates of what i want my patterns to be, so I have tried to make the patterns both ways. Starting from my original art - expanding all shapes and making them so they will tile perfectly.
    1. with clipping mask. 2. released mask, and expanded shape. 3. perfect tile.
    from scratch, made to tile perfectly.
    Same issue for both:
    To make sure it wasn't only this one I tried a different pattern that was giving me the same error before hand.
    I tried with original art which didn't work, so I quickly recreated with squares. Same tile, one time it was empty producing same issue as above. And second time it did this:
    1. What tile is supposed to look like       2. Tile applied to shape - but the pattern swatch icon is empty?
    Maybe this is a program bug?

  • I would like to create a colour swatch in Adobe Muse

    I have just started a trial of all the Adobe CC programs, and was just wondering about creating a colour swatch using the Muse application.
    Could someone give me some help and guidance on how to do this?
    Thank you.

    Look here:

Maybe you are looking for

  • FTP adapter should take file path and name at runtime..

    Hello All, I have requirement of getting the file from remote machine into local machine..thinking FTP adapter should help me to do this.. I dont need to poll the remote directory. rather I will pass the exact path and name of the file to be fetched

  • Smart Album with more than one criteria?

    Can a single smart album have more then one criteria? Every photo of my daughter in my library is tag with her name. I am trying to create a smart album using her name as the keyword that also rated 3 or more stars. The steps I am taking are as follo

  • My i phone isn't charging

    Out of nowhere my phone read not accepting device and wasn't accepting a charge My phone died completely and i have no access to it or anything on it what can i do? Do i still have warramty? how do i find out?

  • Need the the underlying table names which the Material Plan Detail Search p

    Our supply planning users would like to obtain the demand and supply plan for a bunch of given parts by running a query against some tables. The data they need via a PS Query output in Excel format is the same data that is provided by the Material Pl

  • Contracting opportunity for Captivate developer

    Looking for Captivate expertise in Instructional Design for a major project.  Responsibilities include developing 1-2 hour Captivate modules from existing storyboards/scripts. Extremely fast moving project with high visibility. Join an existing team