Getting swatch names of each document item

I'm trying to find a way to loop thru all items in an Illustrator document and get their stroke and fill color.  Sometimes items are spots, sometimes documents are set to RGB or CMYK, etc, so swatches can be a mixture of things.  Is there an easy way to get the swatch name for each item?
For example, I can check if an item is a spot, and get it's color like so:
var c = app.activeDocument.pageItems[0];
if (c.strokeColor.typename === 'SpotColor') {
    var s = c.strokeColor.spot.name;
But if I try to get the name from an item colored 'Black' (which is set to Process Color, CMYK), then I'll need to do something else like:
var c = app.activeDocument.pageItems[0];
if (c.strokeColor.typename === 'CMYKColor') {
    var s = c.strokeColor.name;  // This returns undefined - not sure what I'm doing!!!
Is there an easier way to achieve this, other than getting the typename of each item, and then trying to figure out it's color name?  I was hoping something like this would work:
var c = app.activeDocument.pageItems[0].strokeColor.name;
Thanks!
Jay

Thank you Larry.  This is very helpful to know!
I chatted with a friend, who knows much more about colors, printing, etc. and now I see that I can only get item swatch names when the item is set to a spot (or global I believe).  Process on the other hand will just return specific number values for each color (c, m, y, k).  So I think I have a better understanding now.
Thanks.
Jay

Similar Messages

  • Urgent: How to get the names of all menu items

    I have a .mmb menu module.
    There are many menus and submenus in it.
    Now I want to get the names of all menu items available in the module using sql or pl/sql.
    Actually I need to store these names in another table as it is. That is why I want get them programmatically.
    Any solution please.... bit urgent
    Thanks

    When I needed the same, I wrote my own application using
    Forms API (Windows,Forms 6.0,6i). Perhaps it will help
    you.
    Let me know your e-mail and I'll send it.

  • How to get the texts for each line item for Sales order in a smartform

    I'm createing a smart form in which i need to display certain texts for each line item of a sales order. How can i get those??
    I'm trying with the table STXH and FM read_text... but i'm not clear how and what i'm getting... can anybody pls help me.....

    Hi There,
    But then i will be getting only the value. i want to link that against the particular material of the Purchase Order.
    Like for ex:
    PO No.  Material Code        Line Item        Basic        Excise       Tax       Inv Value
    0000001 5000251                010               100           16         4.64      120.64
    0000001 5000252                020               200           32         9.28      241.28
    Can u help me on this?
    Regards,
    Jitesh

  • How can I get the name of an Array Item in LabVIEW

    Hi,
    I would need to display the name of the items in the Step.Result.Measurement array in a VI. I can access these properties using the index, but I don't know how to get the name of them like Step.Result.Measurement[0] .
    Is there any suggestions to do it in an elegant way?
    Andras

    Hi Andras,
    look here.
    Regards, Guenter

  • Getting artist name on each track

    i download a cd with my laptop then transfer it to my own library on my desktop to save it does not list the artist with each track i have to type the artist for each track can i change this somehow so it will put the artist name next to each track thank you driving me nuts

    With a purchased CD, connected to the Internet, iTunes should find the details ok. However if it happens again, Highlight all the tracks you just imported and right click, choose Get Info, it will ask if you want to update multiple items, say yes and in Info type the artists name and all the tracks will be done at once.

  • How to get CLASS name for the generic item?

    Hi,
    I wrote following method to create a service instance.
    public static <IType> IType GetServiceInstance()
           IType type=null;
            try
            InitialContext ic=new InitialContext();
    //ERROR:      type=   ic.lookup(IType.class.getName());
            catch(Exception ex)
            //do handle
            return type;
        }please see the //Error: here its giving error, also i m not getting "class" variable in IDE!!!
    i want use like this;
    IUserService userService=ServiceFactory.GetServiceInstance<IUserService>();so how can i do this?
    Edited by: Manikandan.Java on Oct 31, 2007 3:02 AM

    I don't know if I understand your question, but you cannot find the class name because it is in run time just an object. You can, however, check if it is an instanceof.
    if (genericType instanceof MyType) {
         doMyThing();
    }

  • TR created for each line item

    hi,
      when i post the document in migo using 311 movement type i am getting separate Tr for each line item,but i need single TR all line items , how to solve the issue.
    Thanks
    Muthuraman.D

    hi,
    thx for your answers but user mistakenly put into different movement types for each line item so different TR is created...now the problem solved.
    thanks
    Muthuraman.D

  • Vendor name from accounting document no

    hi,
    how to get vendor name from accounting document no.
    plz help.

    Hi,
    Use
    Read BSEG table using BELNR and fetch the LIFNR ( Account Number of Vendor or Creditor ) field value and
    Based upon LIFNR read vendor name table LFA1 table using LIFNR field.
    Hope it will helps

  • DP93 SD document item is not account assigned to itself

    HII,
    While running TA DP93 getting error "Sales and distribution document item is not account assigned to itself".
    I have implimented the note 1343813... after technical analysis in the vbap(item table) it's not storing object number.
    Could please share your views..
    Thanks&Regards,
    Siva

    HI,
    EK01 condition has no value updated with actual price and i have linked the object number of sales order item to to DIP Profile.. still no clue why the object number in VBAP has no value.... inorder to process DP93 TA it's checking Sales order item object number.
    Thanks&regards,
    Siva

  • Get comp name and apply expression using it.

    Hey Guys,
    So basically, I've created a Vignette script using cc spotlight.  The only problem is, in order to link some expression between comps, I had to rename the main comp the vignette is being applied to.
    Is there a way to get the name of a comp (the current item) and place it inside of an expression?
    Here is a link to my script. It should make more sense when you check it out.
    http://rapidshare.com/files/456403457/VB_Vignette3.jsx
    Thanks for your help.
    -Tyler

    Yeah, that's the problem......
    I need to get the name of the "active item" (a comp in this case) and use that name inside of an expression.
    Any thoughts?
    Thanks!
    (Dan you're awesome!, love three d corner pin;)

  • Sharepoint 2010 -Script to get file name from Document Library

    Hi 
    can anybody send be script that works in "SharePoint 2010 management Shell" to get list of file names in document library.
    Thank

    See my updated answer. The double quotes need to be removed. Also note that you need to use $item.File.Name
    and not $item.Name to get the name of the files.
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

  • I am trying to sort my documents into folders and name each document.  Can this be done

    I am new to Pages.  I want to put different letters (documents) into a folder - is it possible to name each document within a folder?
    Also, I have blank headed paper that I then pull in to use for letters but I then want to retain the blank headed paper afterwards.  Is there any way of doing that as it appears that once I have used the headed paper for a letter, it gets filed as the new letter and I lose the blank headed paper. 

    can this be done
    Of course.  That's standard behavior.

  • Cannot open Pages documents that I've worked on.  I open a new document, work on it, then save and close it.  When I try to open the document again, I get the following message: The document "[name]" could not be opened. The file isn't in the correct form

    I cannot open Pages documents that I have worked on and saved.  When I try to reopen Pages documents that I've saved, I get the following
    message:
    "The document “[name of document]” could not be opened. The file isn’t in the correct format.
    The file might be corrupted, truncated, or in an unexpected format."
    I have downloaded the latest update to iWork, but that doesn't help.
    I use Mac OSX 10.6.7
    I am using Pages '09 version 4.0.5 (852)
    If anyone can help, I would greatly appreciate it.
    Best regards,
    New York Mac User

    A few general trouble shooting tips that may apply here:
    1. If you used Software Update to do the OS update(s) to reach 10.6.7, go to http://support.apple.com/downloads/ and download and apply the Mac OS v10.6.7 Combo Updater. The Combo Updater contains some fixes that were not included in the incremental updaters used by Software Update.
    1a. Check that you have the current version of Pages (and of the other iWork applications) installed. All three applications' current version numbers end in .0.5
    2. A common cause of malfunctioning applications is a corrupted preferences file (.plist file). Your Pages '09's plist is at yourname > Library > Preferences > com.apple.iWork.pages.plist
    Quit Pages, locate the file and Drag it to the Desktop (or to the Trash).
    Restart Pages and attempt to open one of the files.
    If all is well, Trash the plist file and empty the Trash.
    If there's no change, AND you've made changes to the Preferences that you wish to keep, drag the file back to its previous location, replacing any new one that has been created.
    Regards,
    Barry

  • How to restrict separate payment document for each line item in APP

    HI Experts
    PLs let me know how to restrict separate payment document for each line item in APP
    Thanks
    Sneha
    Edited by: Sneha R on Apr 14, 2009 4:18 PM

    Sneha,
    If your query was to group items for payment ,in FBZP  co code data for payment method there are 2 options 1.group payment for marked items 2.payment per due date.
    Also in the Vendor master there is a flag which will ensure that each item is paid individually,if this is what you were looking for  ( FK02 change vendor).
    In case you want to group items to be paid together Payment Grouping Key can be assigned in Vendor Master .
    Shony

  • Fi document: different tax code for each line item

    Dear All,
    Our FI department needs to post FI documents by uploading the list of line items. For each line item (even when they have the same g/l account) tax code may be different from 0 to 10%. Also the tax code needs to be entered in EUR not in %. So for example they may need to post the folowing document:
              PstKey   Account    Amount     Tax amt
    001     21          Vendor       95 EUR     Tax amount 5 EUR
    002     50          GRIR          100 EUR
    003     21          Vendor       90 EUR     Tax amount 10 EUR
    004     50          GRIR          100 EUR
    At the moment users have to post it manually. Tax rate cannot be restricted to allow tax from 0 to 10%.
    Can you please advice what would be the best approach for them to make it? Providing they do want to upload the document not enter the items manually..
    Thanks a lot in advance for your help!

    Hi,
    are there some messages during this process? Upload this list in foreground batch input execution. Verify if in stop point displays any messagem. If it is the case, go to OBA5 to change its status.
    Let me know results.
    regards

Maybe you are looking for

  • Outlook 2013 Advances search only shows cached emails

    Hi all, We have rolled out Outlook 2013 with cache mode on, we have set caching to only one month of data. We are using Outlook 365 as our exchange server. Quick search works as it should and shows all the results. However, advanced find only shows r

  • My iphone 4 v4.2.1 o/s reboots when trying to access App Store - help !!

    My phone started rebooting itself yesterday afternoon after working perfectly for weeks. I have checked and can access most applications - messages, email, safari, ipod, calendar, itunes, contacts however when trying to access the App Store it trigge

  • Color problem prints from camera only

    I have a Sony DSC H2. It shoots great photos. When I import them into iPhoto, they look great, and they look terrific as desktop backgrounds and computer slideshows. When I print them, using Canon i960, the photos are darker, more saturated and not s

  • Why can't I view my photos on my iphone 4s

    When I take pictures with my iphone 4s they do not show up under photos.  When I try and open photos it just shuts down.  When I click the tab on the bottom left of the Camera application that shows the picture I just took, It takes me to photos, but

  • Phanfare Type Application

    I was hoping for some help. I was asked to develop an app that is similar to Phanfare. www.Phanfare.com Not so much the client application, but the ability for the user to upload photos, add music and do zoom and pan for each picture creating a virtu