[JS CS3] Can't add a swatch to some documents

Hello,
I have the following script:
var myDoc = app.activeDocument;
colorIt(myDoc, "lime",cmykRatios =[40,0,80,0]);
function colorIt(docRef,colorName,cmykRatios){
    docRef.colors.add({colorValue:cmykRatios, colorModel:ColorModel.process, colorSpace:ColorSpace.cmyk,name:colorName});
    }//end colorIt
For some documents this script works as it should. But for others I get the error message in ESTK "An incorrect number of color values was given."
The error message is telling me that I cannot add CMYK swatches. If I change the colorSpace to ColorSpace.rgb and have only three values in the array cmykRatios, then the script works in the document that before would not accept it.
But then trying to add an RGB swatch to the documents that previously accepted the new CMYK swatch gives me the very same error message:  "An incorrect number of color values was given."
Obviously there is some difference between these documents but I cannot see one. Why would one ID file accept CMYK colors but not RGB colors and vice versa? Any clues as to what might be wrong here?
Thanks,
Tom

Hey Tom!
I just tested your script, and it's working fine on new documents. Then, I created swatch with same name but in RGB space, and received same error. Are you sure that you don't have swatch with same name already in document? But, on the other side, why would it work after you change script to RGB. I added one row into your script, so you can test it.
var myDoc = app.activeDocument;
colorIt(myDoc, "lime",cmykRatios =[40,0,80,0]);
function colorIt(docRef,colorName,cmykRatios){
    if(app.activeDocument.swatches.itemByName(colorName).isValid != true){
        docRef.colors.add({colorValue:cmykRatios, colorModel:ColorModel.process, colorSpace:ColorSpace.cmyk,name:colorName});
tomaxxi
http://indisnip.wordpress.com/

Similar Messages

  • Can we add customer logo in performance document printable page in Fusion Performance management Release 9

    Can we add customer logo in performance document printable page in Fusion Performance management Release 9

    Yes - this is a BI Publisher report and you can edit the template to format per your customer requirements. I'd suggest that you save a copy of the changes to file because the report may or may not be overwritten during upgrades.
    John

  • What can I do if Pages updates some document ceaselessly? I would like to delete the document.

    What can I do if Pages updates some document ceaselessly? I would like to delete the document.

    Hi pp,
    I've requested your question be transfered to the iWork for iOS community, where you're more likely to receive a solution specific to Pages for iOS.
    Regards,
    Barry

  • I can't add text to a scanned document-I'm using textedit

    I scanned a receipt page with our logo, name & address & want to add text but when I attach the blank receipt to an email it won't let me add text to the interior of the document

    When you scan a document it makes it like a photographic file, not really editable. You did not indicate what file format the file is in so your post makes very little sense. Perhaps if  you advised what file the receipt is in now someone can provide some advice. Right now, at best if you open the file in Preview you can use Tools - Annotate to do some very minor editing.

  • When I want to add an album onto my iphone using itunes, I am successful in  putting one album on my phone but when I want to add another album it deletes the first album I put on my phone. How can I add more albums without some albums disappearing?

    I am having a problem with importing cds onto my iPhone. I have successfully added a playlist or album to my phone but when I want to add another album/artist, the first album that was on there has all of a sudden disappeared. Its like I can only have one album on my phone. This is my first time dealing with anything Apple because I have been using android phones. Any help would be appreciated as I don't fully understand iTunes.

    You can delete photos from individual albums but not from the camera roll.  If you try to delete a photo from camera roll it will be deleted from all other albums ("locations") that contain the photo.  This is because the actual photo is in the camera roll (the albums only contain links to the photo in camera roll, not the actual photo).

  • Can't add web page to existing document

    I am new to Acrobat 9 Pro (running on Win7). I love the feature where you can convert a web page to pdf and then add a wab page to an existing document. My probelm is that I saved one page as a pdf then went to a different link on that website that appears very similar and tried to add that page to the first one. As many times as I tried, my second page will not appear.
    I did try going to an entirely different website and adding a page to the very same document and I was successful.
    Is it possible that the program won't add the similar page because it is recognizing the page to be the same? Is there a setting to override this? I need to be able to save multiple web pages that appear the same way to one document quickly and easily.

    Thank you for your response. It is possible to do this but I need the 'Add web page to existing doc' feature to work for me. I will be converting a large number of similar pages to pdf and this feature would be perfect if it worked as it is intended. Going back later to insert pages is counter-productive for me.

  • Can't add album art to some tracks

    Using iTunes 7.4.2 (4)
    I have some MP3 files that don't have album art. For some of the albums, I've been able to use iTunes to download the art. For others, I've had to manually copy/paste the art in the Artwork field under the Get Info menu item. But, there are some MP3s that I have that don't have album art and iTunes can't find them. I can go under Get Info and paste some art into the Artwork field (I see it in the field) but when I click OK, it doesn't save. I go back into the Get Info and there's nothing there.
    How can I get album art for these tracks?
    Also, I have a few tracks that have the Artwork tab under Get Info completely grayed out and I can't select it. How can I activate that feature for these tracks?
    Thanks!
    Bronson

    I am not sure how much use this will be, but for what its worth here is the way I add artwork. I don't drag and drop. I mainly use a widget Amazon Art, this alows you to access the Amazon websight and find the appropriate album cover then add it to the iTunes library, one of the operating options is selscted tracks, which involves you highlighting the album before you click on set as album artwork, which I find more relyable than currently playing track or album.
    Slightly more reliable than the widget is to find art work and then copy it (If you use Amazon, its always worth clicking on show larger image of the album). Then select the entire album, in itunes and then use Command (Ctrl on a PC I suspect) and i. This allows you to paste in album art work for the entire album. It has never failed me in the past. One word of warning, be a little careful in editing double albums or various artist albums as it is easy to combine the two albums or make an entire album by a single artist.
    Hope you find his of some help

  • Can we add a variable in the document title of SOFM..

    Hi,
    I am trying to use a variable in the document title as below:
    Approval by: &MANAGER&  =>  &DOCUMENTTITLE&
    But this does not work, the note is getting displayed as:
    Approval by: &MANAGER&, ideally should be "Approval by: Micheal John". Please let me know about this.
    Thanks,
    Sukumar.

    Hi,
    I have the variable "Manager" in the workflow container. In the document title of SOFM. I want to display the DOCUMENTTITLE as " Manager approval by: &Manager&. How can I use the concatenate function here?
    Thanks.
    Sukumar.

  • How can I add bookmarks to documents in Adobe Acrobat

    how can I add book marks to a document in Adobe Acrobat

    Open the Bookmarks panel on the left and click the New Bookmark icon in it, or simply press Ctrl+B.

  • How to add attachment (URL) to parked document inbackground?

    Hi guys,
    I wonder how it is possible to add the URL (of external document) to parked document in the background (with BAPI)?
    After I park document (for example with transaction FV60 or MIR7) a small button (called Services for Object) appears in the left upper corner (on the left side of the transaction heading) and when I click on it I can select option (Create External Document URL). That way I can manually add the link to external document.
    But the thing I need is to add that URL in the background (through BAPI).
    Actually I am doing the following thing: In one other BAPI I need to call BAPI for parking incoming invoice, and in that same BAPI I need to add URL to external document.
    So, what I would like to know is: which BAPI's, or API's or whatsoever are used for creating these attachments, so that I can call them in the background (with another BAPI).
    I would appreciate any kind of help because the project is running, and I can't find any solution for this problem.
    Thanks for help!
    Karlo

    Hi karlo Smojver,
    I am also facing same issue can you please explain me how do you resolved.
    Thanks,
    Sudarshan

  • Can I add a watermark to a video with photoshop CS3 Extended

    Can I add a watermark to a video with photoshop CS3 extended or Web Premium 3, and if I can how do I do it?

    Import the video as a new video layer (Layer --> Video --> New layer from file), add your watermark as another layer, then export the whole shebang using File --> Export --> Render Video. Be aware though, that there are severe limitations in what formats Photoshop accepts, exports and how they are compressed, so you may wish to check out After Effects or other tools...
    Mylenium

  • InDesign CS3 *Can't Load Swatches other than Pantone DS*

    I have InDesign CS3 loaded on two Macs and both (within a week of each other) now have the same problem loading swatches. Whatever I choose - Pantone Solid Uncoated, CMYK, RGB etc - it only allows me to pick a Pantone DS Swatch. If I scroll down the options in the pop up menu the list of colour formats is repeated 3 or 4 times. The only way I can create a new swatch is by duplicating and editing an existing one. Will probably need to reinstall, but discs are currently in storage. Any ideas?

    Terence and Sir Alf,
    Adobe doesn't usually frequent these forums. These are "user-to-user" forums, as they are so named. If you haven't seen other postings, it may be that it's not a very widespread problem because we get quite a bit of traffic here.

  • 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.

  • Illustrator CS3 can't print/save as PDF

    I installed CS3 and the error message:
    "The Save as PDF and Save PDF as PostScript options in the Printer Dialog are not supported"
    Does this mean that its not picking up on the Adobe Acrobat/Distiller 8?
    How would I activate this? Help!!
    Same thing with InDesign CS3, can't print/save as PDF.
    (this is on a mac)

    It may be looking for your RIP ppd, as well as Acrobat 8. Acrobat should have installed all the necessary files, but you might take a look into that. I don't think Distiller is part of the Save-As procedure. You might take a look into "Add-A-Printer" OSX option and select Acrobat 8 there ( although it should have loaded during the install ). Another option is re-install your printer's software and any RIP software ( if available ). Before you do, get whatever updates you can from the manufacturer. It could also mean, after you've done the previous suggestions, you correct permissions on your HD using Apple's Disk Utility. Leave the machine ON overnight so that the Apple Utilities can clean house while you're sleeping.

  • Can't add any more buddies, but i always could, even over the limit..

    On my iChat buddy list (on an AIM account), I have a lot over the 200 maximum, and it has always worked fine. I had almost 300 buddies, and then tried to add a few more. The first one worked, but the second two adds didn't. Is there a way to fix this other than deleting some buddies?

    > I've got a site which is built entirely with AP Divs (in
    CS3). Messy, but
    > quick and easy.
    You pay a serious price for the "quick and easy" part, buy
    you may not be
    aware of it yet.
    > I've got to the stage now though, where I can't add any
    more. I can draw
    > the
    > shape using the Draw AP Div tool, but as soon as I let
    go of the mouse
    > button,
    > the box disappears (it doesn't get as far as becoming a
    blue box).
    There is no limit on the number of AP elements a page can
    have.
    > One thing I have noticed is that if I use design view to
    delete an AP
    > element,
    > it doesn't seem to get removed from the code.
    This would mean that you aren't really removing the element
    from either
    Design or Code view. If the code is there, the element is
    there. If the
    code is not there, the element is not there.
    > Anyone got any ideas?
    It would be hard to diagnose what might be happening without
    seeing your
    page and its code. Can you post a link?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "aliprior" <[email protected]> wrote in
    message
    news:ge1mjo$i4p$[email protected]..
    > Hi,
    >
    > I've got a site which is built entirely with AP Divs (in
    CS3). Messy, but
    > quick and easy.
    >
    > I've got to the stage now though, where I can't add any
    more. I can draw
    > the
    > shape using the Draw AP Div tool, but as soon as I let
    go of the mouse
    > button,
    > the box disappears (it doesn't get as far as becoming a
    blue box).
    >
    > I've checked that it's not hidden beneath another layer.
    >
    > One thing I have noticed is that if I use design view to
    delete an AP
    > element,
    > it doesn't seem to get removed from the code.
    >
    > Anyone got any ideas?
    >
    > Thanks,
    >
    > A
    >

Maybe you are looking for

  • No Playable Episodes Error

    Hi, A search on this topic came up either with solutions that didn't work or no answer. I am helping someone publish a podcast, and it was accepted by iTunes Music Store a couple of weeks ago. Everything works fine if you go to Advanced/Subscribe to

  • Passing partition name as a variable

    hi all i'm trying to pass a variable as the partition name in my select query and getting the fallowing error. SQL> DECLARE 2 PARTITION_NAME VARCHAR2(15) := 'PAR_JAN08'; 3 BEGIN 4 SELECT * FROM TEST_T PARTITION('PARTITION_NAME'); 5 END; 6 / SELECT *

  • SAPSCRIPT to save as external file

    is it possible that i can save my output in SAPSCRIPT in an external file like MS Word? thanks

  • Source system initialization error in ERPI using EBS,

    Hi, I am trying to initialize source system details in ERP Integrator(workspacce) using EBS detials,for loading to Planning. Add source system is success,then click on Initialize button I got this error: Error encountered while launching the ODI Proc

  • Error in PREPARE_JSPM_QUEUE phase

    While attempting to install EHP4 for ECC6/EHP1 for Netweaver I am failing during the PREPARE_JSPM_QUEUE phase I am getting the following error and looking for suggestions. The parsing of SP stack file e:\download\SMSDXML_CROSSSYS_20090610175030.663.x