Creating Custom Swatches
Is there a way in Illustrator CS3 or CS4 to add individual swatches or a group of swatches that have specific names for my workflow into the swatches panel? I have found that I can do this with a new document with the "New Document Profile" and also I can load a custom swatch library in Illustrator.
I would like a few certain swatches to always show up in the swatches panel, or to quickly load them, without browsing thru several windows.
Do I need a script to do this?
Maari
You do not need a script but yu do this I copied it from my post on another thread.
The way yo do this is go to the Users/Username/Library/Application
Support/Adobe/US_en/Adobe Illustrator CS 4/New Document Presets/Print
if that is the preset you use to create new files or any of the others
or do this to all of preset files.
You open the file in AI and you take your the colors you want as
swatches and load them in the swatches panel and delete all the others
and save the file or save as and over write the file. Yu n then import
those swatches into the other presets and you save those as well to
the same location overwriting the originals.
Now when you open a new document for print or any other preset you
have only the colors you want.
http://forums.adobe.com/thread/446074?tstart=0
Similar Messages
-
Why do my custom swatches revert to RGB mode?
Hi all,
I'm a newbie to Illustrator. I have a few questions:
When I create custom swatches, I choose the CYMK option in the drop down box. However, these swatches are appearing as "RGB" mode in my swatch palette. Why is that? How do I ensure my custom swatches stay in CMYK mode?
When I later view the CMYK code for the swatches, I see that their numbers are skewed a little (for example, 34 may be 35 or 36, etc). Why is that?When you create a new document, make sure the color mode of the document matches with the swatch color mode. i.e if you're creating a new document in RGB and then using a CMYK swatch then the numbers will be converted to RGB. Make sure the document is also created in CMYK color mode by expanding the advaced options in new document creation dialog box.
-
Create a custom swatch textile pattern
Hi,
Yet another noob.
First off - is there anyway to edit the textile pattern swatches in AI? There is a pattern of lines I like but not in the right color. If not then I guess I need to create my own.
What I want is a pattern of colored lines (pink and white) close together that run at a 45 degree angle from bottom to top. I think I am supposed to draw a rectangle and then create each line and then save this as a custom swatch? Is there a better way of doing this to ensure spacing consistency??
Appreciate any help
Thank YouI concur with Kurt. This by all means should be easy enough and while the AI help is hugely ominous and incomprehensible to the uninitiated otherwise (it is simply incomplete, poorly written and contains wrong information), that part is explained resonably well. Also read up/ search this forum on how to replace/ update swatches and symbols using drag to artboard and (Alt-)drag back to the palette....
Mylenium -
I just started using PS (CS6) and I added 10 new custom swatches that I want to save in a new swatch library. However, I still have the PS default library of swatches listed (that contains scores of colors). Can I select multiple swatches at once to save them for the swatch library? Or do I need to delete ALL the default swatches first manually, then save the remaining colors in the new swatch library? If so, it makes it a daunting task...
I watched a tutorial on the Preset Manager and was able to finally select multiple swatches to create a swatch library by using the [Shift] key while selecting.
One of the problems was that the swatches were displaying as small thumbnails and it was difficult for me to see each swatch selected (plus, the outline of the selections were blue, and many of the colors I selected were blue).
What also through me off was that when you display swatches in a pane (say, when working on an image), one of the dropdown options is "Save Swatches", which I thought allowed you to save swatches in a library (not just an individual swatch).
Without the tutorial, I don't think I would have been able to figure out the right steps! Thanks for the tips, guys. -
Custom Swatch Palette (beta)
Hi yall,
I created this custom swatch palette which allows a person to keep swatch info in this palette and instantiate it in documents. The palette can store notes about a particular swatch and there is a save button somewhere which will save your palette state as an xml file.
//==================================================HOBO SWATCHES by Vasily ===========================================//
// BETA
* @@@BUILDINFO@@@ Hobo Swatches_v1.jsx !Version! Sat Jan 18 2014 22:36:40 GMT-0600
function swatchPalette(){
//===================================================Icon Resources========================//
var infoBtnSrc='({total:2, '+
'shape_1:{fillColor:[0.11, 0.18, 1], name:"", tag:"", strokeColor:null, pathPoints:[10, 3, 5, 5], ellipsePath:true, closed:true}, '+
'shape_0:{fillColor:[0.11, 0.18, 1], name:"", tag:"", strokeColor:null, pathPoints:[[15, 15], [15, 11], [18, 11], [18, 9], [13, 9], [8, 9], [8, 11], [11, 11], [11, 15], [7, 15], [7, 17], [19, 17], [19, 15]], ellipsePath:false, closed:true}})';
var addBtnSrc='({total:1, '+
'group_0:{'+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0, 0.14, 1], pathPoints:[[19, 9], [14, 9], [14, 4], [12, 4], [12, 9], [7, 9], [7, 11], [12, 11], [12, 16], [14, 16], [14, 11], [19, 11]], ellipsePath:false, closed:true, strokeWidth:2}, '+
'shape_0:{fillColor:[1, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[19, 9], [14, 9], [14, 4], [12, 4], [12, 9], [7, 9], [7, 11], [12, 11], [12, 16], [14, 16], [14, 11], [19, 11]], ellipsePath:false, closed:true}, total:2}})';
var rmvBtnSrc='({total:2, '+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0, 0.22, 0], pathPoints:[[20, 9], [6, 9], [6, 11], [20, 11]], ellipsePath:false, closed:true, strokeWidth:3}, '+
'shape_0:{fillColor:[0.27, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[20, 9], [6, 9], [6, 11], [20, 11]], ellipsePath:false, closed:true}})';
var rstBtnSrc='({total:2, '+
'group_1:{'+
'shape_1:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[45, 4, 12, 12], ellipsePath:true, closed:true, strokeWidth:2}, '+
'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[51, 12], [51, 2]], ellipsePath:false, closed:false, strokeWidth:3}, total:2}, '+
'group_0:{'+
'shape_7:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[5, 16], [5, 5], [11, 5], [11, 10], [7, 10], [12, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_6:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[20, 5], [15, 5], [15, 15], [19, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_5:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[14, 10], [18, 10]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_4:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[34, 5], [29, 5], [29, 15], [34, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_3:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[29, 10], [32, 10]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[21, 15], [26, 15], [26, 10], [22, 10], [22, 5], [27, 5]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[39, 16], [39, 5]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.75, 0.36, 0], pathPoints:[[35, 5], [42, 5]], ellipsePath:false, closed:false, strokeWidth:2}, total:8}})';
var labModelSrc='({total:3, '+
'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[1, 1, 1], pathPoints:[[4, 2], [4, 8], [7, 8]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0, 1, 1], pathPoints:[[12, 3], [12, 8], [9, 8], [9, 5], [12, 5]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[1, 1, 0], pathPoints:[[15, 2], [15, 8], [18, 8], [18, 5], [15, 5]], ellipsePath:false, closed:false, strokeWidth:2}})';
var cmykModelSrc='({total:4, '+
'shape_3:{fillColor:[0, 1, 1], name:"", tag:"", strokeColor:null, pathPoints:[[2, 9], [5, 9], [5, 8], [3, 8], [3, 3], [5, 3], [5, 2], [2, 2]], ellipsePath:false, closed:true}, '+
'shape_2:{fillColor:[1, 0, 1], name:"", tag:"", strokeColor:null, pathPoints:[[10, 3], [9, 3], [9, 4], [8, 4], [8, 3], [7, 3], [7, 2], [6, 2], [6, 3], [6, 5], [6, 9], [7, 9], [7, 5], [8, 5], [8, 6], [9, 6], [9, 5], [10, 5], [10, 9], [11, 9], [11, 2], [10, 2]], ellipsePath:false, closed:true}, '+
'shape_1:{fillColor:[1, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[16, 2], [16, 3], [15, 3], [15, 4], [14, 4], [14, 3], [13, 3], [13, 2], [12, 2], [12, 4], [13, 4], [13, 5], [14, 5], [14, 9], [15, 9], [15, 5], [16, 5], [16, 4], [17, 4], [17, 2]], ellipsePath:false, closed:true}, '+
'group_0:{'+
'shape_4:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[19, 5], [19, 2], [18, 2], [18, 9], [19, 9], [19, 6], [20, 6], [20, 5]], ellipsePath:false, closed:true}, '+
'shape_3:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[20, 8], [21, 8], [21, 6], [20, 6]], ellipsePath:false, closed:true}, '+
'shape_2:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[22, 9], [22, 8], [21, 8], [21, 9]], ellipsePath:false, closed:true}, '+
'shape_1:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[21, 3], [20, 3], [20, 5], [21, 5]], ellipsePath:false, closed:true}, '+
'shape_0:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[22, 2], [21, 2], [21, 3], [22, 3]], ellipsePath:false, closed:true}, total:5}})';
var rgbModelSrc='({total:5, '+
'shape_4:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[2, 2], [2, 9], [3, 9], [3, 3], [5, 3], [5, 5], [3, 5], [3, 7], [4, 7], [4, 6], [6, 6], [6, 2]], ellipsePath:false, closed:true}, '+
'shape_3:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[5, 8], [5, 7], [4, 7], [4, 8]], ellipsePath:false, closed:true}, '+
'shape_2:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[6, 9], [6, 8], [5, 8], [5, 9]], ellipsePath:false, closed:true}, '+
'shape_1:{fillColor:[0, 1, 0], name:"", tag:"", strokeColor:null, pathPoints:[[7, 9], [11, 9], [11, 6], [9, 6], [9, 7], [10, 7], [10, 8], [8, 8], [8, 3], [10, 3], [10, 4], [11, 4], [11, 2], [7, 2]], ellipsePath:false, closed:true}, '+
'shape_0:{fillColor:[0, 0, 1], name:"", tag:"", strokeColor:null, pathPoints:[[13, 5], [13, 3], [15, 3], [15, 5], [16, 5], [16, 2], [12, 2], [12, 9], [16, 9], [16, 6], [15, 6], [15, 8], [13, 8], [13, 6], [15, 6], [15, 5]], ellipsePath:false, closed:true}})';
var grayModelSrc='({total:7, '+
'shape_6:{fillColor:[0.57, 0.58, 0.59], name:"", tag:"", strokeColor:null, pathPoints:[[7, 2], [7, 9], [8, 9], [8, 3], [10, 3], [10, 5], [8, 5], [8, 7], [9, 7], [9, 6], [11, 6], [11, 2]], ellipsePath:false, closed:true}, '+
'shape_5:{fillColor:[0.57, 0.58, 0.59], name:"", tag:"", strokeColor:null, pathPoints:[[10, 8], [10, 7], [9, 7], [9, 8]], ellipsePath:false, closed:true}, '+
'shape_4:{fillColor:[0.57, 0.58, 0.59], name:"", tag:"", strokeColor:null, pathPoints:[[11, 9], [11, 8], [10, 8], [10, 9]], ellipsePath:false, closed:true}, '+
'shape_3:{fillColor:[0.82, 0.82, 0.83], name:"", tag:"", strokeColor:null, pathPoints:[[2, 9], [6, 9], [6, 6], [4, 6], [4, 7], [5, 7], [5, 8], [3, 8], [3, 3], [5, 3], [5, 4], [6, 4], [6, 2], [2, 2]], ellipsePath:false, closed:true}, '+
'shape_2:{fillColor:[0.35, 0.36, 0.38], name:"", tag:"", strokeColor:null, pathPoints:[[15, 3], [13, 3], [13, 2], [15, 2]], ellipsePath:false, closed:true}, '+
'shape_1:{fillColor:[0.35, 0.36, 0.38], name:"", tag:"", strokeColor:null, pathPoints:[[15, 3], [15, 5], [13, 5], [13, 3], [12, 3], [12, 9], [13, 9], [13, 6], [15, 6], [15, 9], [16, 9], [16, 3]], ellipsePath:false, closed:true}, '+
'shape_0:{fillColor:[0.2, 0.22, 0.24], name:"", tag:"", strokeColor:null, pathPoints:[[21, 2], [21, 3], [20, 3], [20, 4], [19, 4], [19, 3], [18, 3], [18, 2], [17, 2], [17, 4], [18, 4], [18, 5], [19, 5], [19, 9], [20, 9], [20, 5], [21, 5], [21, 4], [22, 4], [22, 2]], ellipsePath:false, closed:true}})';
var noteMarkSrc='({total:4, '+
'shape_3:{fillColor:[0.53, 0.33, 0.26], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[11, 21], [11, 14], [4, 14]], ellipsePath:false, closed:true, strokeWidth:1}, '+
'shape_2:{fillColor:[1, 0.97, 0.62], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[11, 21], [1, 21], [1, 14], [7, 14], [11, 19]], ellipsePath:false, closed:true, strokeWidth:1}, '+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[1, 17], [6, 17]], ellipsePath:false, closed:false, strokeWidth:1}, '+
'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[1, 19], [6, 19]], ellipsePath:false, closed:false, strokeWidth:1}})';
var okBtnSrc='({total:2, '+
'group_1:{'+
'shape_5:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[11, 5], [5, 5], [5, 15], [11, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_4:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[28, 5], [22, 5], [22, 15], [28, 15]], ellipsePath:false, closed:true, strokeWidth:2}, '+
'shape_3:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[14, 4], [14, 15], [19, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_2:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[45, 5], [40, 5], [40, 15], [45, 15]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[40, 10], [43, 10]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.39, 0.31, 0], pathPoints:[[31, 15], [36, 15], [36, 10], [32, 10], [32, 5], [37, 5]], ellipsePath:false, closed:false, strokeWidth:2}, total:6}, '+
'group_0:{'+
'shape_2:{fillColor:[0, 0, 0], name:"", tag:"", strokeColor:[0.57, 0.58, 0.59], pathPoints:[47, 2, 15, 15], ellipsePath:true, closed:true, strokeWidth:1}, '+
'shape_1:{fillColor:null, name:"", tag:"", strokeColor:[0.93, 0.11, 0.14], pathPoints:[[51, 13], [58, 6]], ellipsePath:false, closed:false, strokeWidth:2}, '+
'shape_0:{fillColor:null, name:"", tag:"", strokeColor:[0.93, 0.11, 0.14], pathPoints:[[58, 13], [51, 6]], ellipsePath:false, closed:false, strokeWidth:2}, total:3}})';
var addToDocBtnSrc='({total:5, '+
'shape_4:{fillColor:[1, 1, 0.59], name:"", tag:"", strokeColor:[0.14, 0.12, 0.13], pathPoints:[[22, 16], [13, 16], [13, 9], [17, 5], [22, 5]], ellipsePath:false, closed:true, strokeWidth:2}, '+
'shape_3:{fillColor:[0.14, 0.12, 0.13], name:"", tag:"", strokeColor:null, pathPoints:[[11, 13], [8, 13], [8, 4], [11, 4]], ellipsePath:false, closed:true}, '+
'shape_2:{fillColor:[0.14, 0.12, 0.13], name:"", tag:"", strokeColor:null, pathPoints:[[5, 10], [5, 7], [14, 7], [14, 10]], ellipsePath:false, closed:true}, '+
'shape_1:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[13, 9], [6, 9], [6, 8], [13, 8]], ellipsePath:false, closed:true}, '+
'shape_0:{fillColor:[1, 0, 0], name:"", tag:"", strokeColor:null, pathPoints:[[10, 5], [10, 12], [9, 12], [9, 5]], ellipsePath:false, closed:true}})';
//===================================================Basic Functions========================//
var UIElements=[Window,Group,EditText,Panel];
for(var i=0; i<UIElements.length; i++){
UIElements[i].prototype.setBg=function(rgb){
this.graphics.backgroundColor=this.graphics.newBrush(this.graphics.BrushType.SOLID_COLOR, [rgb[0],rgb[1],rgb[2]]);
function round2(num){
return Math.round(num*100)/100;
var env=ScriptUI.environment;
function convertAppColor(src,dest,clrArr){
return app.convertSampleColor(ImageColorSpace[src], clrArr, ImageColorSpace[dest], ColorConvertPurpose.defaultpurpose);
function currentTime(){
var time=new Date();
var hours=time.getHours();
var minutes=time.getMinutes();
var seconds=time.getSeconds();
if(seconds<10){seconds='0'+seconds;}
if(minutes<10){minutes='0'+minutes;}
var ampm=function(){
if(hours>12){
hours-=12;
return 'pm';
} else {
if(hours==0){hours=1;}
return 'am';
return (hours)+":"+minutes+":"+seconds+" "+ampm;
function getUIRGB(type, clr){
for(var x=0; x<clr.length; x++){
clr[x]=clr[x]*1;
if(type=="RGB"){
return [round2(clr[0]/255),round2(clr[1]/255),round2(clr[2]/255)];
} else if(type=="CMYK"){
var newArr=convertAppColor("CMYK","RGB",[clr[0],clr[1],clr[2],clr[3]]);
return [round2(newArr[0]/255),round2(newArr[1]/255),round2(newArr[2]/255)];
} else if(type=="GRAY"){
var newArr=convertAppColor("GrayScale","RGB",[clr[0]]);
return [round2(newArr[0]/255),round2(newArr[1]/255),round2(newArr[2]/255)];
} else if(type=="LAB"){
var newArr=convertAppColor("LAB","RGB",[clr[0],clr[1],clr[2]]);
return [round2(newArr[0]/255),round2(newArr[1]/255),round2(newArr[2]/255)];
} else {
return [0.5,0.5,0.5];
//===================================================Advanced Functions========================//
//===================================XML=============//
function wrapCDATA(str, propNm){
str = '<data>'+str+'</data>';
str = str.replace(/(\<data\>)/g, '<'+propNm+'><![CDATA[');
str = str.replace(/(\<\/data\>)/g,']]\>'+'</'+propNm+'>');
return XML(str);
function stringXmlSafe(str){
str=str.toString();
str=str.replace(/&(?!(amp;|gt;|lt;|quot;|apos;))/g,"&");
str=str.replace(/</g,"<");
str=str.replace(/>/g,">");
str=str.replace(/'/g,"'");
str=str.replace(/"/g,""");
return str;
function getXmlSwatchesArr(xmlFile){
var myFile=xmlFile;
myFile.open('r');
myFile.seek(0,0);
var fileStr=myFile.read();
myFile.close();
var xmlObj=XML(fileStr);
var swatchArr=[];
for(var x=0, ln=xmlObj.children().length(); x<ln; x++){
var sw={};
var thisSw=xmlObj.children()[x];
sw.name=thisSw.descendants("name").toString();
sw.aiSwatchKind=thisSw.descendants("aiswatchkind").toString();
var comp=thisSw.descendants("colorcomp");
sw.colorComp={};
sw.colorComp.mode=comp.descendants("mode").toString();
sw.colorComp.comp=[];
for(var y=0, ln_2=thisSw.descendants("colorcomp").descendants("colorvalues").children().length(); y<ln_2; y++){
sw.colorComp.comp.push(thisSw.descendants("colorcomp").descendants("colorvalues").childre n()[y]*1);
sw.notes=thisSw.descendants("notes");
sw.originDoc=thisSw.descendants("origindoc").toString();
swatchArr.push(sw);
return swatchArr;
function getXmlSwatchesXML(swatchArr){
XML.prettyIndent=4;
var xmlBody=new XML('<swatches></swatches>');
for(var i=0; i<swatchArr.length; i++){
var thisSw=swatchArr[i];
xmlBody.appendChild(new XML("<swatch></swatch>")); xmlBody.swatch[i].@order=i+1;
xmlBody.swatch[i].appendChild(new XML("<name>"+stringXmlSafe(thisSw.name)+"</name>"));
if(thisSw.name!='none'){
if(thisSw.info && thisSw.info.plating){
thisSw.aiSwatchKind=thisSw.info.plating;
thisSw.colorComp.mode=thisSw.colorComp.typename;
thisSw.originDoc=thisSw.info.originDoc;
thisSw.notes=thisSw.info.notes;
xmlBody.swatch[i].appendChild(new XML("<aiswatchkind>"+stringXmlSafe(thisSw.aiSwatchKind)+"</aiswatchkind>"));
xmlBody.swatch[i].appendChild(new XML("<colorcomp></colorcomp>"));
xmlBody.swatch[i].colorcomp[0].appendChild(new XML("<mode>"+stringXmlSafe(thisSw.colorComp.mode)+"</mode>"));
xmlBody.swatch[i].colorcomp[0].appendChild(new XML("<colorvalues></colorvalues>"));
for(var j=0; j<thisSw.colorComp.comp.length; j++){
xmlBody.swatch[i].colorcomp[0].colorvalues[0].appendChild(new XML("<value>"+stringXmlSafe(thisSw.colorComp.comp[j])+"</value>"));
xmlBody.swatch[i].notes=wrapCDATA(thisSw.notes, 'notes');
xmlBody.swatch[i].origindoc=stringXmlSafe(thisSw.originDoc);
return xmlBody;
//===================================end XML=============//
// gets type and color array from swatch in swatch palette - for BT
function getAISwatchColor(processColorOrSpot,name){
function round2(num){
return Math.round(num*100)/100;
var result={type:null, name:null, colorArr:null, uiColor:null, plating:null, originDoc:null, creDt:null, rgbClr:null, cmykClr:null, grayClr:null, labClr:null};
var clr=processColorOrSpot;
result.name=name;
if(clr=="[RGBColor]"){
result.type="RGB"; result.colorArr=[round2(clr.red),round2(clr.green),round2(clr.blue)];
result.uiColor=[clr.red/255,clr.green/255,clr.blue/255]; result.plating='Process';
} else if(clr=="[CMYKColor]"){
result.type="CMYK"; result.colorArr=[round2(clr.cyan),round2(clr.magenta),round2(clr.yellow),round2(clr.black )]; result.uiColor=function(){
var newArr=convertAppColor("CMYK","RGB",[clr.cyan,clr.magenta,clr.yellow,clr.black]);
return [newArr[0]/255,newArr[1]/255,newArr[2]/255,];
}(); result.plating='Process';
} else if(clr=="[GrayColor]"){
result.type="GRAY"; result.colorArr=[round2(clr.gray)]; result.uiColor=function(){
var newArr=convertAppColor("GrayScale","RGB",[clr.gray]);
return [newArr[0]/255,newArr[1]/255,newArr[2]/255,];
}(); result.plating='Process';
} else if(clr=="[SpotColor]"){
clr=clr.spot;
if(clr.colorType==ColorModel.SPOT){
result.plating='Spot';
} else if(clr.colorType==ColorModel.PROCESS){
result.plating='GlobalProcess';
} else if(clr.colorType==ColorModel.REGISTRATION){
result.plating='Registration';
} else {
result.plating="Process";
var intClr=clr.getInternalColor();
for(var i=0; i<intClr.length; i++){
intClr[i]=round2(intClr[i]);
if(clr.spotKind==SpotColorKind.SPOTLAB){
result.type="LAB"; result.colorArr=intClr; result.uiColor=function(){
var newArr=convertAppColor("LAB","RGB",[intClr[0],intClr[1],intClr[2]]);
return [newArr[0]/255,newArr[1]/255,newArr[2]/255,];
} else if(clr.spotKind==SpotColorKind.SPOTRGB){
result.type="RGB"; result.colorArr=intClr; result.uiColor=[intClr[0]/255,intClr[1]/255,intClr[2]/255];
} else if(clr.spotKind==SpotColorKind.SPOTCMYK){
result.type="CMYK"; result.colorArr=intClr; result.uiColor=function(){
var newArr=convertAppColor("CMYK","RGB",[intClr[0],intClr[1],intClr[2],intClr[3]]);
return [newArr[0]/255,newArr[1]/255,newArr[2]/255,];
var colorMode=result.type;
if(colorMode=="GRAY"){
colorMode="GrayScale";
var altClrs=[
result.rgbClr=convertAppColor(colorMode, "RGB", result.colorArr),
result.cmykClr=convertAppColor(colorMode, "CMYK", result.colorArr),
result.grayClr=convertAppColor(colorMode, "GrayScale", result.colorArr),
result.labClr=convertAppColor(colorMode, "LAB", result.colorArr),
for(var c=0; c<altClrs.length; c++){
for(var d=0; d<altClrs[c].length; d++){
altClrs[c][d]=round2(altClrs[c][d]);
result.originDoc=app.activeDocument.name;
result.creDt=currentTime();
return result;
function drawPath(shp, canvas){
var thisShp=shp;
if(thisShp.ellipsePath!=true){
var vectorPts=thisShp.pathPoints;
canvas.newPath(); canvas.moveTo(thisShp.pathPoints[0][0],thisShp.pathPoints[0][1]);
for(var j=0; j<vectorPts.length; j++){
var thisAnchor=vectorPts[j];
var x=thisAnchor[0], y=thisAnchor[1];
canvas.lineTo(x,y);
if(thisShp.closed==true){
canvas.closePath();
} else {
var cirPts=thisShp.pathPoints;
canvas.newPath();
canvas.ellipsePath(round2(cirPts[0]), round2(cirPts[1]), round2(cirPts[2]), round2(cirPts[3]));
canvas.closePath();
if(thisShp.fillColor!=null){
var clr=thisShp.fillColor;
var myBrush=canvas.newBrush(canvas.BrushType.SOLID_COLOR,clr);
canvas.fillPath(myBrush);
if(thisShp.strokeColor!=null){
var clr=thisShp.strokeColor;
var myPen=canvas.newPen(canvas.PenType.SOLID_COLOR,[clr[0],clr[1],clr[2],1], thisShp.strokeWidth);
canvas.strokePath(myPen);
function drawImg(objString, canvasArea){
// using drawPath();
var obj=eval(objString.replace(/(^'|';$)/g,''));
var canvas=canvasArea.graphics;
var counter=obj.total;
while(counter>=0){
for(all in obj){
if(all.match(/\d{1,2}$/g) && all.match(/\d{1,2}$/g)==counter){
var thisShp=obj[all];
if(all.match('group')){
var ctr=obj[all].total;
while(ctr>=0){
for(paths in obj[all]){
if(paths.match(/\d{1,2}$/g) && paths.match(/\d{1,2}$/g)==ctr){
drawPath(obj[all][paths], canvas);
ctr--;
} else {
drawPath(thisShp, canvas);
counter-=1;
function btnSkin(elem,aClr,w,h){
var g=elem.graphics; var brush=g.newBrush(g.BrushType.SOLID_COLOR,aClr);
g.newPath(); g.moveTo(1,1); g.lineTo(w-1,1); g.lineTo(w-1,h-1); g.lineTo(1,h-1); g.closePath(); g.fillPath(brush);
var ltr=[aClr[0]*1.2,aClr[1]*1.2,aClr[2]*1.2];
for(var c=0; c<ltr.length; c++){
if(ltr[c]>1){
ltr[c]=1;
brush=g.newBrush(g.BrushType.SOLID_COLOR,ltr); g.newPath(); g.rectPath(0,0,w,h/2); g.fillPath(brush);
var pen=g.newPen(g.PenType.SOLID_COLOR,[1,1,1,1],2);
g.newPath(); g.moveTo(1,1); g.lineTo(w-1,1); g.lineTo(w-1,h-1); g.lineTo(1,h-1); g.closePath();
g.strokePath(pen);
function createAltDisp(swObj, uiParent){
var altClrs=swObj.info.altClrs;
var modes=['CMYK','RGB','LAB','GRAY'];
for(var m=0; m<modes.length; m++){
if(swObj.colorComp.typename!=modes[m]){
var altG=uiParent.add('panel',undefined,modes[m]); altG.margins=[2,6,2,2];
altG.size=[80,88]; altG.spacing=2; altG.alignChildren='left';
if(modes[m]=="RGB"){
altG.add('statictext',undefined,'R: '+altClrs.rgbClr[0]);
altG.add('statictext',undefined,'G: '+altClrs.rgbClr[1]);
altG.add('statictext',undefined,'B: '+altClrs.rgbClr[2]);
} else if(modes[m]=="CMYK"){
altG.add('statictext',undefined,'C: '+altClrs.cmykClr[0]);
altG.add('statictext',undefined,'M: '+altClrs.cmykClr[1]);
altG.add('statictext',undefined,'Y: '+altClrs.cmykClr[2]);
altG.add('statictext',undefined,'K: '+altClrs.cmykClr[3]);
} else if(modes[m]=="LAB"){
altG.add('statictext',undefined,'L: '+altClrs.labClr[0]);
altG.add('statictext',undefined,'A: '+altClrs.labClr[1]);
altG.add('statictext',undefined,'B: '+altClrs.labClr[2]);
} else if(modes[m]=="GRAY"){
altG.add('statictext',undefined,'Black: '+altClrs.grayClr[0]);
function swatchInfoBox(swObj, uiParent){
var baseG=uiParent; // usually a group
var g_1=baseG.add("panel",undefined,"Swatch Info"); g_1.size=[340,340]; g_1.spacing=2; g_1.margins=[4,12,4,4];
var nameD=g_1.add('edittext',undefined,swObj.name,{readonly:true}); nameD.characters=20; nameD.justify='center';
if(swObj.name!='none'){
var mode=swObj.colorComp.typename;
var sep=g_1.add('panel'); sep.size=[310,2];
var g_1_0=g_1.add('group');
var txtG=g_1_0.add('group'); txtG.orientation='column'; txtG.spacing=2; txtG.margins=[2,2,2,2]; txtG.alignChildren='left';
txtG.add('statictext',undefined,'Color Model: '+swObj.colorComp.typename);
txtG.add('statictext',undefined,'Illustrator Swatch Type: '+swObj.info.plating);
var swD=g_1_0.add('panel'); swD.size=[34,34]; swD.setBg(swObj.fillColor);
var sep_1=g_1.add('panel'); sep_1.size=[310,2];
var g_1_1=g_1.add('group'); g_1_1.spacing=2;
if(mode=="RGB"){
var rD=g_1_1.add('statictext',undefined,'Red: '+swObj.colorComp.comp[0]+',');
var gD=g_1_1.add('statictext',undefined,'Green: '+swObj.colorComp.comp[1]+',');
var bD=g_1_1.add('statictext',undefined,'Blue: '+swObj.colorComp.comp[2]);
} else if(mode=="CMYK"){
var cD=g_1_1.add('statictext',undefined,'Cyan: '+swObj.colorComp.comp[0]+',');
var mD=g_1_1.add('statictext',undefined,'Magenta: '+swObj.colorComp.comp[1]+',');
var yD=g_1_1.add('statictext',undefined,'Yellow: '+swObj.colorComp.comp[2]+',');
var kD=g_1_1.add('statictext',undefined,'Black: '+swObj.colorComp.comp[3]);
} else if(mode=="LAB"){
var lD=g_1_1.add('statictext',undefined,'Luminance: '+swObj.colorComp.comp[0]+',');
var aD=g_1_1.add('statictext',undefined,'a: '+swObj.colorComp.comp[1]+',');
var bD=g_1_1.add('statictext',undefined,'b: '+swObj.colorComp.comp[2]);
} else if(mode=="GRAY"){
var gD=g_1_1.add('statictext',undefined,'Gray-Scale Black: '+swObj.colorComp.comp[0]);
var g_1_2=g_1.add('group');
createAltDisp(swObj, g_1_2);
var sep_2=g_1.add('panel'); sep_2.size=[310,2];
var originDocG=g_1.add('group'); originDocG.orientation='row';
var originDocH=originDocG.add('statictext',undefined,"Originating Document");
var originDocE=originDocG.add('edittext',undefined,swObj.info.originDoc,{readonly:true}); originDocE.characters=18;
var g_1_3=g_1.add('panel',undefined,'Notes'); g_1_3.margins=[2,8,2,2]; g_1_3.spacing=2;
var notesE=g_1_3.add('edittext',undefined,'',{readonly:true, multiline:true}); notesE.size=[310,60];
if(swObj.info && swObj.info.notes && swObj.info.notes!=''){
notesE.text=swObj.info.notes;
var notesBtnG=g_1_3.add('group');
var viewBigBtn=notesBtnG.add('button',undefined,"View Big");
var editBtn=notesBtnG.add('button',undefined,"Edit Notes");
var clearBtn=notesBtnG.add('button',undefined,"Clear Notes");
viewBigBtn.onClick=function(){
if(notesE.text!=''){
var notesW=new Window('dialog',"Notes in a bigger window:"); notesW.margins=[4,4,4,4];
var bignotesE=notesW.add('edittext',undefined,notesE.text,{multiline:true, readonly:true}); bignotesE.size=[300,360];
var closeNotes=notesW.add('button',undefined,"Ok");
notesW.show();
} else {
alert("There are no notes here.");
editBtn.onClick=function(){
var editResult=function(){
var newNotes=null;
var w=new Window('dialog','Edit Notes');
var inst=w.add('statictext',undefined,"Tip: use Ctrl+Return to enter in a carriage-return.");
var editE=w.add('edittext',undefined,notesE.text,{multiline:true}); editE.size=[310,160]; editE.active=true;
var btnG=w.add('group');
var okBtn=btnG.add('button',undefined,'Set Notes (OK)');
var cclBtn=btnG.add('button',undefined,'Cancel');
okBtn.onClick=function(){
if(editE.text.replace(/\s/g)!=''){
newNotes=editE.text;
} else {
newNotes='';
w.close();
w.show();
return newNotes;
if(editResult!=null){
notesE.text=editResult;
swObj.info.notes=editResult;
swObj.noteChange=currentTime();
clearBtn.onClick=function(){
if(confirm("Are you sure you want to clear the notes?")==true){
notesE.text='';
swObj.info.notes='';
swObj.noteChange=currentTime();
function infoWindow(SESSION){ //======================================MINI UI
var noteChange;
var userChoice={showMode:SESSION.options.showMode, showNotes:SESSION.options.showNotes, noteChange:false};
var swatchBox=function(){
if(SESSION.selection.length==0){
return null;
} else if(SESSION.selection.length==1){
return SESSION.selection[0];
} else if(SESSION.selection.length>1){
return "--Multiple Selection--";
var w=new Window('dialog',"Swatch Info & Preferences"); w.margins=[4,4,4,4];
var g_0=w.add('group'); g_0.orientation='column'; g_0.spacing=4;
var g_0_1=g_0.add("group");
if(swatchBox!=null){
if(swatchBox=="--Multiple Selection--"){ // Multi
var msg=g_0_1.add('statictext',undefined,swatchBox);
} else { //Single
if(swatchBox.name!='none'){
noteChange=swatchBox.noteChange;
swatchInfoBox(swatchBox, g_0_1);
} else {
var msg=g_0_1.add('statictext',undefined,"Empty Cell");
} else { // NONE
//var msg=g_0_1.add('statictext',undefined,"NONE");
var g_0_1=g_0.add("panel",undefined,"Main Window Prefrences"); g_0_1.size=[340,44]; g_0_1.orientation='column';
var boxGrp=g_0_1.add('group');
var modelBx=boxGrp.add('checkbox',undefined,"Show Color Mode"); modelBx.value=SESSION.options.showMode;
var noteBx=boxGrp.add('checkbox',undefined,"Show Note Marker"); noteBx.value=SESSION.options.showNotes;
var g_0_2=g_0.add("panel",undefined,"Persistence Options"); g_0_2.size=[340,54];
var saveBtn=g_0_2.add('button',undefined,"Save Current Session");
var okBtn=w.add('button',undefined,'Ok'); okBtn.size=[340,20]; okBtn.margins=[0,0,0,0];
okBtn.onClick=function(){
w.close();
saveBtn.onClick=function(){
var swcs=SESSION.swatchBoxes, swcsLn=SESSION.swatchBoxes.length;
var dir=SESSION.presetFolder;
var saveFl=File(dir+"/HoboSwatchSession.xml");
var blank=function(){
for(var s=0; s<swcsLn; s++){
if(swcs[s].name!='none'){
return false;
return true;
var go=false;
if(blank==true){
if(confirm('Set saved session to all blanks?',true,'Confirm this action:')==true){
go=true;
} else if(confirm('Save current session?',true,'Confirm this action:')==true){
go=true;
if(go==true){
if(!dir.exists){
dir.create();
saveFl.open('w');
saveFl.write('<?xml version="1.0"?>\r'+getXmlSwatchesXML(swcs));
saveFl.close();
if(saveFl.exists){
alert("Successfully Saved in: "+decodeURI(saveFl),'SUCCESS!');
} else {
alert("Sorry, "+decodeURI(saveFl)+"'s save operation was NOT successful!",'Failure... Horrible abysmal failure. :\'(');
w.show();
userChoice.showMode=modelBx.value;
userChoice.showNotes=noteBx.value;
userChoice.noteChange=function(){
if(swatchBox!=null && (swatchBox.noteChange != noteChange)){
return true;
return false;
return userChoice;
//===================================================For Bridge Talk========================//
function asSourceString(func, withArgs){
if(withArgs!=undefined && withArgs==true){
return func.toSource().toString().replace("(","").replace(/\)$/,"");
} else {
return func.toSource().toString().replace("(function "+func.name+"(){","").replace(/}\)$/,"");
function sendBTmsg(func, updateObj, resultFunc, resultFuncArgs){
if(updateObj==undefined){updateObj={self: 'nothing'}};
var updateObjName=updateObj.self;
if(updateObjName!=undefined){
var bt=new BridgeTalk;
bt.target='illustrator';
var btMsg=asSourceString(func);
for(all in updateObj){
if(all!='self'){
var rx=new RegExp(updateObjName+'\\.'+all,'g');
btMsg=btMsg.replace(rx,updateObj[all]);
bt.body=btMsg;
//$.write(btMsg);
if(resultFunc!=undefined){
bt.onResult=function(result){
resultFunc(result.body, resultFuncArgs);
bt.send();
} else {
$.writeln("Error, function 'sendBTmsg(func, updateOb)': the update object should have a 'self' property, indentifying its' name.");
function doNothing(){
var nothing=function(){
return;
function initSwatch(SESSION, sw, name, mode, clrArr, uiClr, info){ // Result of getting document swatches.
sw.fillColor=uiClr;
sw.name=name;
if(mode=="RGB" || mode=="LAB"){
sw.colorComp={typename:ColorComp[mode].typename,comp:[clrArr[0],clrArr[1],clrArr[2]]};
} else if(mode=="CMYK"){
sw.colorComp={typename:ColorComp[mode].typename,comp:[clrArr[0],clrArr[1],clrArr[2],clrAr r[3]]};
} else if(mode=="GRAY"){
sw.colorComp={typename:ColorComp[mode].typename,comp:[clrArr[0]]};
sw.colorComp.name=sw.name;
SESSION.nameDisplay.text=sw.name;
sw.info=info;
sw.addDrawPhase(sw.coloredState);
if(info.plating=="Spot"){
sw.addDrawPhase(sw.spotMark);
} else if(info.plating=="GlobalProcess"){
sw.addDrawPhase(sw.globalMark);
if(SESSION.options.showMode==true){
sw.addDrawPhase(sw[mode+'Model']);
if(SESSION.options.showNotes==true && sw.info && sw.info.notes!=''){
sw.addDrawPhase(sw.noteMark);
if(sw.selected==true){
sw.removeDrawPhase(sw.selectedMark);
sw.addDrawPhase(sw.selectedMark);
sw.refresh();
sw.instantiated=true;
sw.elem.helpTip=sw.getInfo();
//=========<<<<<<<<<<<<<<<BT Function
function bt_func(){
var outcome={swatches:[],};
if(app.documents.length>0){
var doc=app.activeDocument;
var swcs=doc.swatches.getSelected();
if(swcs.length>0){
BTOBJ.func_convertAppColor;
BTOBJ.func_currentTime;
BTOBJ.func_getAISwatchColor;
for(var s=0; s<swcs.length; s++){
var thisSw=swcs[s];
if(thisSw.color!="[PatternColor]" && thisSw.color!="[GradientColor]"
&& thisSw.name!="[Registration]" && thisSw.name!="[None]"){
outcome.swatches.push(getAISwatchColor(thisSw.color, thisSw.name));
outcome=outcome.toSource();
} else {
alert("Please select some swatches from the document's swatches palette.");
} else {
alert("Please open a document with swatches.");
function bt_func_rt(objString, args){ //puts swatches into palette.
var docSws=eval(objString).swatches; var SESSION=args[0];
for(var s=0; s<docSws.length; s++){
var thisSw=docSws[s];
if(SESSION.selection[s]!=undefined){
if(thisSw.name!='none'){
var sw=SESSION.selection[s];
var info={plating: thisSw.plating, originDoc: thisSw.originDoc,
altClrs:{rgbClr:thisSw.rgbClr,cmykClr:thisSw.cmykClr,labClr:thisSw.labClr,grayClr:thisSw. grayClr},
notes: '',
initSwatch(SESSION, sw, thisSw.name, thisSw.type, thisSw.colorArr, thisSw.uiColor, info);
} else {
alert("Sorry, can't have a swatch by the name of '"+thisSw.name+"'");
function bt_func_2(){
BTOBJ.func_currentTime;
var outcome={};
if(app.documents.length>0){
var doc=app.activeDocument;
var swcs=eval(BTOBJ.sessionSelection);
var nonConflictingSwatches=[];
for(var s=0; s<swcs.length; s++){
var thisSw=swcs[s];
try{
doc.swatches.getByName(thisSw.name);
continue;
} catch(e){
nonConflictingSwatches.push(thisSw);
for(var s=0; s<nonConflictingSwatches.length; s++){
var thisSw=nonConflictingSwatches[s];
for(var t=0; t<nonConflictingSwatches.length; t++){
var thisOtherSw=nonConflictingSwatches[t];
if(t!=s && thisSw.name==thisOtherSw.name){
nonConflictingSwatches.splice(s,1);
s=0;
break;
if(nonConflictingSwatches.length>0){
var swG=doc.swatchGroups.add(); var d=new Date();
swG.name="Added at "+((d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear()+" "+currentTime());
for(var s=0; s<nonConflictingSwatches.length; s++){
var thisSw=nonConflictingSwatches[s];
if(thisSw.plating!='Process'){
var dsw=doc.spots.add();
if(thisSw.colorComp.typename=="LAB"){
dsw.colorType=ColorModel.SPOT;
dsw.color=function(){
if(thisSw.colorComp.typename=="RGB"){
var c=new RGBColor();
c.red=thisSw.colorComp.comp[0];
c.green=thisSw.colorComp.comp[1];
c.blue=thisSw.colorComp.comp[2];
return c;
} else if(thisSw.colorComp.typename=="CMYK"){
var c=new CMYKColor();
c.cyan=thisSw.colorComp.comp[0];
c.magenta=thisSw.colorComp.comp[1];
c.yellow=thisSw.colorComp.comp[2];
c.black=thisSw.colorComp.comp[3];
return c;
} else if(thisSw.colorComp.typename=="LAB"){
var c=new LabColor();
c.l=thisSw.colorComp.comp[0];
c.a=thisSw.colorComp.comp[1];
c.b=thisSw.colorComp.comp[2];
return c;
} else if(thisSw.colorComp.typename=="GRAY"){
var c=new CMYKColor();
c.cyan=0;
c.magenta=0;
c.yellow=0;
c.black=thisSw.colorComp.comp[0];
return c;
dsw.name=thisSw.name;
if(thisSw.plating=="Spot"){
dsw.colorType=ColorModel.SPOT;
} else if(thisSw.plating=="GlobalProcess"){
dsw.colorType=ColorModel.PROCESS;
swG.addSpot(dsw);
} else {
var dsw=doc.swatches.add();
var color=function(){
if(thisSw.colorComp.typename=="RGB"){
var c=new RGBColor();
c.red=thisSw.colorComp.comp[0];
c.green=thisSw.colorComp.comp[1];
c.blue=thisSw.colorComp.comp[2];
return c;
} else if(thisSw.colorComp.typename=="CMYK"){
var c=new CMYKColor();
c.cyan=thisSw.colorComp.comp[0];
c.magenta=thisSw.colorComp.comp[1];
c.yellow=thisSw.colorComp.comp[2];
c.black=thisSw.colorComp.comp[3];
return c;
} else if(thisSw.colorComp.typename=="GRAY"){
var c=new GrayColor();
c.gray=thisSw.colorComp.comp[0];
return c;
dsw.color=color;
dsw.name=thisSw.name;
swG.addSwatch(dsw);
outcome=outcome.toSource();
} else {
alert("Please open a document with swatches.");
//===================================================Used Objects========================//
var BTOBJ={
self: "BTOBJ",
doNothing: asSourceString(doNothing),
func_getAISwatchColor: asSourceString(getAISwatchColor, true),
func_convertAppColor: asSourceString(convertAppColor, true),
func_currentTime: asSourceString(currentTime, true),
func_round2: asSourceString(round2, true),
sessionSelection: null,
var ColorComp={
CMYK:{typename:'CMYK', name:'', comp: [0,0,0,0]},
RGB:{typename:'RGB', name:'', comp: [0,0,0]},
LAB:{typename:'LAB', name:'', comp: [0,0,0]},
GRAY:{typename:'GRAY', name:'', comp: [0]},
NULL:{typename:'NULL', name:'None', comp:null},
function SwatchBox(elem){
this.uiOrder=elem.order;
this.name='none';
this.elem=elem;
this.colorComp=ColorComp.NULL;
this.elem.parentObj=this; // access constructor through UI element.
this.selected=false;
this.instantiated=false;
this.refresh=function(){
this.assignOnDraw(this.currentDrawingState);
this.elem.hide(); this.elem.show();
this.elem.helpTip='none';
this.fillColor=[0.4,0.4,0.4];
this.selectedMark={id: 'selected',
func:function(elem){
var g = elem.graphics;
var pen=g.newPen(g.PenType.SOLID_COLOR,[0,0,0,0.7],3);
g.rectPath(2, 2, 19, 19); g.strokePath(pen);
pen=g.newPen(g.PenType.SOLID_COLOR,[1,1,1,1],2);
g.newPath(); g.moveTo(2,7); g.lineTo(2,2); g.lineTo(7,2); g.strokePath(pen);
g.newPath(); g.moveTo(21,7); g.lineTo(21,2); g.lineTo(16,2); g.strokePath(pen);
g.newPath(); g.moveTo(2,16); g.lineTo(2,21); g.lineTo(7,21); g.strokePath(pen);
g.newPath(); g.moveTo(21,16); g.lineTo(21,21); g.lineTo(16,21); g.strokePath(pen);
this.coloredState={id:'colored',
func:function(elem){
var g = elem.graphics;
var pen=g.newPen(g.PenType.SOLID_COLOR,[0.7,0.7,0.7,1],1);
var brush=g.newBrush(g.BrushType.SOLID_COLOR,elem.parentObj.fillColor);
g.newPath(); g.moveTo(1,1); g.lineTo(22,1); g.lineTo(22,22); g.lineTo(1,22); g.closePath();
g.fillPath(brush); g.strokePath(pen);
this.noneState={id:'none',
func:function(elem){
var g = elem.graphics;
var pen=g.newPen(g.PenType.SOLID_COLOR,[0.7,0.7,0.7,1],1);
var brush=g.newBrush(g.BrushType.SOLID_COLOR,[0.4,0.4,0.4]);
g.newPath(); g.moveTo(1,1); g.lineTo(22,1); g.lineTo(22,22); g.lineTo(1,22); g.closePath();
g.strokePath(pen); g.fillPath(brush);
this.spotMark={id:'spot',
func:function(elem){
var g = elem.graphics;
var brush=g.newBrush(g.BrushType.SOLID_COLOR,[1,1,1]), pen=g.newPen(g.PenType.SOLID_COLOR,[0.7,0.7,0.7,1],1);
g.newPath(); g.moveTo(22,13); g.lineTo(22,22); g.lineTo(13,22); g.closePath();
g.fillPath(brush); g.strokePath(pen);
g.newPath();
brush=g.newBrush(g.BrushType.SOLID_COLOR,[0,0,0]);
g.ellipsePath(18,18,2,2); g.fillPath(brush);
this.globalMark={id:'global',
func:function(elem){
var g = elem.graphics;
var brush=g.newBrush(g.BrushType.SOLID_COLOR,[1,1,1]), pen=g.newPen(g.PenType.SOLID_COLOR,[0.7,0.7,0.7,1],1);
g.newPath(); g.moveTo(22,13); g.lineTo(22,22); g.lineTo(13,22); g.closePath();
g.fillPath(brush); g.strokePath(pen);
this.noteMark={id:'notes',
func:function(elem){
drawImg(noteMarkSrc, elem);
this.LABModel={id:'labmodel',
func:function(elem){
drawImg(labModelSrc, elem);
this.GRAYModel={id:'graymodel',
func:function(elem){
drawImg(grayModelSrc, elThank you W_J_T and here is the place where I got my drawing from:
http://forums.adobe.com/message/5819478#5819478
* I posted the latest update at the bottom on Jan 25 2014.
The principles of this method are to draw by reading the string object and that;s how you can change colors and things by changing the eval-led objects and redrawing them with putting an updating function into OnDraw and hiding/showing the element to force the OnDraw. If you end up using this , I'd like to see some examples! -
Custom Swatch Libraries color shift
I created a custom swatch library for my client in Illustrator. RGB values.
I loaded the library in a new document (RGB Color Mode) and filled an element with one of these loaded swatch colors.
When I double-clicked the color in the fill box, the RGB color values had shifted slightly. Why is this?
When I double-clicked the same color in the Swatch panel, the color values remained accurate.It's a collection of logo versions. Some for web, some for print.
Sounds like I'd need the following Libraries (this is getting complicated and confusing--am I too far in the weeds on this or right where I should be?):
1. Pantones for Print.
Create a document with a Print Profile, set the document color mode to CMYK.
Open the Pantone+ Solid Coated Library, and bring in the given colors.
*Here's the thing though. Illustrator CC's Pantone values for RGB and CMYK don't match the RGB and CMYK values in Pantone+ Color Bridge Book exactly.
So what do I do? Also create a CMYK Library of CMYK equivalents that do match the Pantone+ Color Bridge Book? Because when Illustrator does the conversion, it's way off.
2. Pantones for Web.
Create a document with a Web Profile, set the document color mode to RGB.
Open the Pantone+ Solid Coated Library, and bring in the given colors.
Then also create an RGB Library of RGB equivalents that do match the Pantone+ Color Bridge Book?
This would total 4 Libraries. Pantones for Print. CMYK. Pantones for Web. RGB. -
Cannot find my custom swatch files to share with InDesign
I have created some custom swatch files in Photoshop and would like use them in InDesign as well - but I can't find them! They are always there and available for use in PS, but I cannot find them anywhere on my hard drive. The "Color Swatches" file under "Presets" in PS contains just the swatches that came with the software; I have searched the hard drive for other *.aco files or folders containing such files, but turned up nothing.
Any ideas?
CS4 and Snow Leopard.I have created some custom swatch files in Photoshop and would like use them in InDesign as well - but I can't find them! They are always there and available for use in PS, but I cannot find them anywhere on my hard drive. The "Color Swatches" file under "Presets" in PS contains just the swatches that came with the software; I have searched the hard drive for other *.aco files or folders containing such files, but turned up nothing.
Any ideas?
CS4 and Snow Leopard. -
Hi All,
This may be a stupid question:
Once I have created and saved a custom swatch library - lets call it "custom"
How would I add a new colour to "custom" - or edit a colour value in "custom" - is this new swatch library locked?
Most frustrating.
Thank youopen the library file, just through File > Open. add a swatch to the document. save the document swatches as swatch library
-
Common custom swatch libraires
I have several custom swatch libraires that I'd like to share among all my Adobe apps & macs. Is there a commom place that I can put them, so I dont have to copy to every Swatch Libraries folder for each app? I'd like to have 1 common place to put them, so that Photoshop, Illustrator, Indesign for CS6 & CC would see them. I'm usually adding more custom swatches and was trying to avoid copy to 6 different places, then to multiple machines.
Maybe if you ask nicely on the Scripting forums - perhaps someone could create a script to use your .ase files to update all your swatches across apps.
I don't know how to do it - so I'll leave it at that.
http://forums.adobe.com/community/indesign/indesign_scripting
There's also the Adobe Bridge Scripting Forum
http://forums.adobe.com/community/bridge/bridge_scripting
Which might be a better place for this. -
Custom swatches. Where do I put them?
I recently downloaded some custom paper swatches from Neenah Paper to use with a letterhead design I'm creating. Where is the best place to save custom paper swatches on my Mac? Is there a common folder I can put them in that will allow me to share the custom swatches amongst all of my Adobe apps?
Thanks!The Neenah downloads are .ase files so you have to load them into the app's swatches panel. In ID if you load them without any docs open they will be in the panel for every new document.
The swatches Neenah is providing are spot color ink swatches defined as CMYK, so I don't really see how they would be useful for simulating a paper. In InDesign there's only one Paper swatch [Paper] so if you want to try and simulate ink on a colored paper, edit the [Paper] swatch and turn on Overprint while you work. -
Adobe Captivate 8 - How to Remember Project Custom Swatches
Is there a way to replace default swatches with custom swatches 'permanently', for example by embedding them in a template? I've created a template with my custom swatches but it doesn't seem to be a solution. Captivate loads the swatches panel with default swatches each time I create a new file or open an existing project.
I know, the whole color work flow in Captivate is bit mysterious, and most users don't bother about it. The swatches panel was almost not used in CP7. I ended up by creating my own swatches in the scratch area of a project if colors were important, and I believe consistency in colors is important, don't misunderstand me.
Now it has improved a little bit, but I'm still trying to figure out the best work flow. You are right, I should expect to be able to save my swatches panel either with a workspace, or within the Preferences, or if you want within the Object Style manager. But Captivate has not even a foreground/background color button, it used to have two color buttons in the vertical toolbox that they banned from the present version
With each new project I try to find out a better way to manage colors, but still didn't succeed. And you are very rare, there are almost never questions about color management. Glad I'm not alone anymore.
What I'm doing at this moment, is transfer 10 colors to a theme color palette from the swatches panel. Those 10 colors are also bit of a mystery. Some are used in the provided themes, some not. And the names don't correspond always with the objects they are used for (Subtitle is not used for subtitles, to give one example). But those theme colors, when applied to the theme, will result in changes of some object styles (not all...another question mark) and they are mostly available when a color dialog box pops up. I say mostly, they will for Fill, Stroke and Gradient colors, for some learning interactions but not for all. The 'tints' are based on the theme colors, color 4 is a theme color, color 5 is darker, the first three are lighter. That provides me in total 50 tints based on the theme colors.
A template is really a bridge too far, at least if you use that word as it is meant in Captivate for a cptl file, because I see the word template used for a lot of files, even for themes and almost never for a template.
Your theme color palette will be saved in the workspace, can be reused for any theme. And if you edit also the Object styles, those that are not yet adapting the to theme colors and the Skin you can save that theme as a custom theme and reuse it later for any project, of the same kind. Because themes for responsive projects can be used for normal projects but not the other way.
Sorry for that long answer, still not satisfied with it, just the result of my personal exploration. A blog post about that is not really worthwhile since almost nobody seems to care about colors. When consulting or repairing projects I do see more overridden styles than normal ones.
Lilybiri -
How to create Custom error message in SharePoint 2013
Hi,
I have created one document library.On uploading the same file SharePoint throws error as"server error.The same file exit".
But my requirement is not to show the SharePoint default message.I wanted to create custom message and show the pop up for the same file upload.
Is there any way to create any custom error page or can I manipulate SharePoint default error page?
Any help?
Thank youHi,
You can create an event receiver to set the validation error messages. One such post to redirect the custom error page is as follows
https://social.msdn.microsoft.com/Forums/office/en-US/2bc851f6-e04b-4550-b87f-9b874a290482/sharepoint-event-receivers-and-custom-error-messages?forum=sharepointdevelopmentlegacy
Create custom error page for SharePoint event receiver
Please mark it answered, if your problem resolved or helpful. -
I am planning to create custom defined DSO Object & Info cube
Hi ,
i am planning to create custom defined DSO Object & Info cube.what ratio i can calculate what is the keyfields & what are the data fields in DSO.How can i calculate.
2. how can i create suitable dimensions, suitable characterstics for dimensions.what ratio i can decide.
Thanks,
chandu.Hi Diego Garu,
Thanks for your fast response.i
VBELN VBAP 2LIS_11_VAITM 0DOC_NUMBER
POSNR VBAP 2LIS_11_VAITM 0S_ORD_ITEM
KUNNR VBAK 2LIS_11_VAHDR 0SOLD_TO
VBELN VBRP 2LIS_13_VDITM 0BILL_NUM
FKDAT VBRK 2LIS_13_VDHDR 0BILL_DATE
INCO1 VBRK 2LIS_13_VDHDR(INCO1FieldNot Available in Data Source) 0INCOTERMS
ZTERM VBRK 2LIS_13_VDHDR(Payment terms field Not Available in Data Source) 0UCPYTERMS
NETWR VBRP 2LIS_13_VDITM 0NETVAL_INV.
here data is coming from the multible tables.that why i am planning to create custom defined data source based on view. here how can i calucate dso is suitable or cube is suitable.
suppose dso is suitable how can i decide which on is the data field and which one is the key field.
how can i decide how many dimensions are needed here.and which chara are suitable for that dimensions.
Thanks ,
chandu. -
How to Created custom report for Ship not Billed (SD/FI)?
Hi all,
I am anticipating to write some abap reports..Here is one of them..
Anyone can help me with writing a Report , how to do 'Custom Report for shipped not Billed(SD/FI)' ..But since I am new to Abap , if you wish to reply, please use a little more detail and simple explanation, step by step so I can understand what is the idea, how it can be acheived...what kind of report should be used , techniques, tables etc...:)
Appreciate your help!
Regards,
BobyHi Boby,
You need to create custom transaction to achive these results.
you will have selection-screen ,it would be :
Date : Here date would be mandatory - Ranges Option
Customer - Optional field - Ranges
Order # Sales Order (Optional) Ranges
Invoice # - Invoice # (Optional) Ranges
You will get the data based on ur selection-screen criteria ...
First you will have customer order details from diffrent table
VBAK,
VBAP,
LIKP
LIPS
VBRK,
VBRP
KNA1,
VBFA Tables ( See the my sample program )
Output would be :
Customer # Custome Name Order # Delivery # Invoice # Netpr, Netquantity ,
Check the condition whether invoice table has VBRK-RFBSK = ''.
See the my sample program : This is sales report by monthly..
REPORT ZFDSALES_REPORT no standard page heading
message-id zwave.
Data Declaration Part
TYPE-POOLS
type-pools : slis.
Tables
tables : VBAK,
VBAP.
Internal table for VBAK Table
data : begin of i_vbak occurs 0,
vbeln like vbak-vbeln,
bstnk like vbak-bstnk,
vdatu like vbak-vdatu,
end of i_vbak.
Internal table for VBAP and MATNR
data : begin of i_vbap occurs 0,
vbeln like vbap-vbeln,
matnr like vbap-matnr,
kdmat like vbap-kdmat,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
maktx like makt-maktx,
end of i_vbap.
Internal tables
data : begin of i_sales occurs 0,
vdatu like vbak-vdatu,
bstnk like vbak-bstnk,
matnr like vbap-matnr,
maktx like makt-maktx,
kdmat like vbap-kdmat,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
end of i_sales.
Variable for ALV
data : v_repid like sy-repid,
gt_fieldcat type slis_t_fieldcat_alv.
Selection-screen
selection-screen : begin of block blk with frame title text-001.
select-options : s_vbeln for vbak-vbeln,
s_erdat for vbak-erdat,
s_ernam for vbak-ernam,
s_vdatu for vbak-vdatu obligatory,
s_BSTNK for vbak-BSTNK,
s_KUNNR for vbak-kunnr,
s_matnr for vbap-matnr,
s_KDMAT for vbap-KDMAT.
selection-screen : end of block blk.
Initilization
initialization.
v_repid = sy-repid.
S T A R T - O F - S E L E C T I O N ****************
start-of-selection.
Get the data from VBAK and VBAP Tables
perform get_vbak_vbap.
E N D - O F - S E L E C T I O N *****************
end-of-selection.
Display the data
perform dispolay_data.
*& Form get_vbak_vbap
Get the data from VBAK and VBAP Table
FORM get_vbak_vbap.
Get the data from VBAK Table
select vbeln bstnk vdatu from vbak into table i_vbak
where vbeln in s_vbeln
and bstnk in s_bstnk
and vdatu in s_vdatu
and kunnr in s_kunnr
and erdat in s_erdat
and ernam in s_ernam.
if sy-subrc ne 0.
message e000(zwave) with 'No data found for given selection'.
endif.
Get the data from VBAP Table
select avbeln amatnr akdmat akwmeng a~netpr
b~maktx into table i_vbap
from vbap as a inner join makt as b on bmatnr = amatnr
for all entries in i_vbak
where a~vbeln in s_vbeln
and a~kdmat in s_kdmat
and a~abgru = space
and a~matnr in s_matnr
and a~matnr ne '000000000000009999'
and a~matnr ne '000000000000004444'
and a~matnr ne '000000000000008888'
and a~matnr ne '000000000000001111'
and a~werks = '1000'
and b~spras = 'E'
and a~vbeln = i_vbak-vbeln.
if sy-subrc ne 0.
message e000(zwave) with 'No data found for given selection'.
endif.
sort i_vbak by vbeln.
sort i_vbap by vbeln matnr.
loop at i_vbap.
read table i_vbak with key vbeln = i_vbap-vbeln
binary search.
if sy-subrc eq 0.
i_sales-bstnk = i_vbak-bstnk.
i_sales-vdatu = i_vbak-vdatu.
i_sales-matnr = i_vbap-matnr.
i_sales-kdmat = i_vbap-kdmat.
i_sales-maktx = i_vbap-maktx.
i_sales-netpr = i_vbap-netpr.
i_sales-kwmeng = i_vbap-kwmeng.
append i_sales.
else.
continue.
endif.
clear : i_sales,
i_vbap,
i_vbak.
endloop.
sort i_sales by vdatu bstnk matnr.
refresh : i_vbap,
i_vbak.
ENDFORM. " get_vbak_vbap
*& Form dispolay_data
Display the data
FORM dispolay_data.
Fill the Fiedlcat
PERFORM fieldcat_init using gt_fieldcat[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_sales
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " dispolay_data
*& Form fieldcat_init
text
-->P_GT_FIELDCAT[] text
FORM fieldcat_init USING e01_lt_fieldcat type slis_t_fieldcat_alv.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Delivery Date
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'VDATU'.
LS_FIELDCAT-OUTPUTLEN = 12.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Delivery Date'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Purchase Order #Material Description
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'BSTNK'.
LS_FIELDCAT-OUTPUTLEN = 25.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Purchase Order #'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material
CLEAR LS_FIELDCAT.
LS_FIELDCAT-REF_FIELDNAME = 'MATNR'.
LS_FIELDCAT-REF_TABNAME = 'MARA'.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Material #'.
ls_fieldcat-seltext_M = 'Material #'.
ls_fieldcat-seltext_S = 'Material #'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material Description
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MAKTX'.
LS_FIELDCAT-OUTPUTLEN = 40.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Material Description'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Customer Material #
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'KDMAT'.
LS_FIELDCAT-OUTPUTLEN = 35.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Customer material no.'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Quantity
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'KWMENG'.
LS_FIELDCAT-OUTPUTLEN = 15.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Quantity'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Net Price
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'NETPR'.
LS_FIELDCAT-OUTPUTLEN = 15.
LS_FIELDCAT-TABNAME = 'I_SALES'.
ls_fieldcat-seltext_L = 'Net Price'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
ENDFORM. " fieldcat_init
Reward Points if it is helpful
Thanks
Seshu -
How to create custom cloumns in report
Hi,
I want to create custom columns in the reports(columns which are not present in active subject area. Please help.
Thanks
ArpitaArpita,
You can create a calculated column using any Field (Presentation Column) in any Presentaion Table.
Eg: You want to calculate the difference between the Start and End Date of an Activity.
1. Simply Create a report on the Activities SA (Analytics or Real-time doe not matter here)
2. Add the required Coumns
3. To calculate the difference between the Start and End time.
- add the below fields from Activity
- Click the 'Fx' icon any field that you would like to display the calculated value in.
- Replace the existing formula in this field with TIMESTAMPDIFF(SQL_TSI_DAY, Activity."Created Date", Activity."Completed Date") - This is your calculated value
Activity ID Subject Created Date Completed Date Difference
AXXX-IHJ1W Prepare Proposal 10/31/2011 6:39:43 AM 11/18/2011 4:48:54 AM 18
For more details, I would suggest you look at the CRM On Demand Bookshelf or click the hlp link in CRM On Demand.
Hope this helps!
Thanks,
Royston
Maybe you are looking for
-
Small differences between while canceling invoice.
Hello, While checking the accounting documents I have notices that there are small differences between the GR document invoice document. The differences has occurred on GR\IR account and stock account during canceling the invoice and is 0.01 EUR. T
-
Lenovo x220 Wifi stops with external monitor
Hi. When I plug an external monitor into my X220 the WIFI seems to cease. As soon as I unplug the monitor all is fine. Any ideas? Thank you.
-
hi all! Does somebody know how to change the Axis of a BIBeans Graph in a JavaApplication? i want to change the dimension which appears in the graph with one of the page dimensions. is that possible? how? greetz pm
-
Is it possible to update a Form (SAPbouiCOM.Form)using xml I would to add controls such as datagrid to the opened form using xml The will form is Add-on form, not an SBO Form Any hint Sincerely yours Riade Asleh Edited by: Rui Pereira on Dec 23, 200
-
Trial version still two computers?
I can see all of the discussions about using two computers with Creative Cloud when you purchase a license. I'd like to trial it today on my PC but when I get home I'll be working on my Mac. Is the trial version fine on two computers as well? Thanks