How can I get scripting access to color values in the indexed Color Table?

Hey all,
I'm relatively new to Photoshop scripting, but I've just finished a script that helps my fiance with some very tedious tasks related to textile design.
The last issue that I'm having is that the image I start with is indexed and has a very specific Color Table pallete ( 2-12 colors max + black and white, so 14 max total, sometimes as few as 2 ). Part of my script, I create a number of color chips and fill them with black currently... What I'd like is to be able to get a count of the colors in the Color Table and put the actual color values as hex into an 1 dimension array, so that I fill those black chips I've made with the actual colors from the Color Table.
( I don't know if it makes a difference but I'm converting the image to RGB mode at some point in the script, and back to Indexed Exact ).
Can anyone please help me do this? Needs to be compatible with CS5 and CS6 ideally.
Thanks!!

Cheers for that, your code works but what had thrown me was that the collections appear to be empty - so I hadn't actually tried retrieving one, I just assumed I was looking in the wrong place.
So if I do this in my Immediate window:
 App.Current.Resources.Count
 0
Yet when I request it, I get one:
 App.Current.Resources["TitleTextStyle"]
 {Windows.UI.Xaml.Style}
     base {Windows.UI.Xaml.DependencyObject}: {Windows.UI.Xaml.Style}
     BasedOn: {Windows.UI.Xaml.Style}
     IsSealed: false
     Setters: {Windows.UI.Xaml.SetterBaseCollection}
     TargetType: {Name = "TextBlock" FullName = "Windows.UI.Xaml.Controls.TextBlock"}
Looking at the resources object itself, I get similar apparently empty collections:
 App.Current.Resources
 {Windows.UI.Xaml.ResourceDictionary}
     base {Windows.UI.Xaml.DependencyObject}: {Windows.UI.Xaml.ResourceDictionary}
     Count: 0
     IsReadOnly: false
     Keys: Count = 0
     MergedDictionaries: {Windows.UI.Xaml.DependencyObject}
     Source: null
     ThemeDictionaries: {Windows.UI.Xaml.ResourceDictionary}
     Values: Count = 0

Similar Messages

  • My Mountain Lion app failed while downloading, and now I can't download it without repaying for it.  How can I get my access code to work/download the app?

    My Mountain Lion app failed while downloading, and now I can't download it without repaying for it.  How can I get my access code to work/download the app?

    Welcome to Apple Support Communities
    Open App Store, select Account in Quick Links and press Show hidden purchases. If OS X isn't there, http://www.apple.com/support/mac/app-store/contact

  • How can I get all tracks from an album into the album in my library?

    When importing the albums from a folder, the tracks for some of the albums were split up.  How can I get them in one?

    Hello JudyD276
    The article below will give the steps to get the songs grouped together for you.
    Why aren't songs with the same album art grouped together?
    http://support.apple.com/kb/TS1468
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • My friend synced a video to my ipod but it erased all my data on my ipod,but i cant figure out how to load my old libray back without deleting the movie. my friend cant tell me the password. How can I get my old library back without deleting the movie?

    My friend synced a video to my ipod but it earased all my data on my ipod,but I can't figure out how to load my old library back without deleting the movie. My friend shares a family account so she can't tell me the password. How can i get my old library back without deleting the movie?

    Linnwarner wrote:
    She does have the right because she bought the movie.
    Not true at all.
    You only buy the right to your own personal use.
    You do NOT have the right to distribute to others.
    This is illegal.  There is no doubt about it

  • How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them

    How can I get my books that I download from the Library that are WMA files into my I tunes so I can listen to them. They have a ton of books but I can only listen to them from my windows media player and I wouldlove to download to my I pod but I have tried everything I can think of it they won't go over.  Someone said all I had to do was copy them over and they would convert but I can't even get them to copy.  Thanks.

    Well it started happening AGAIN with my 2nd IPod. No matter what I did, it Itunes would NOT restore it!
    I finally installed Itunes on my hubby's PC at work and managed to get it restored there.
    Apparently, there must be some sort of compatibility issue with the windows version of Itunes and some other piece of software on my pc.
    And one more important thing! I had to follow the instructions in the other thread that talks about how to correctly uninstall itunes and quicktime, in order to completely eliminate ALL traces of my "first" ipod's existence so it wouldn't demand that I restore it.
    I think the software got "confused" and thought when I connected my 2nd ipod, that it was the 1st and that it still needed to be restored.
    Basically, this is just POORLY written and POORLY tested software!

  • How can I get a file to copy all of the files in a directory except itself and the source of the copy function will be the directory the final program is in?

    How can I get a file to copy all of the files in a directory except itself and the source of the copy function will be the directory the final program is in? This application must be in Lab View 8.

    you mean something like this (see below)?
    Now you may have to implement code to check if the destination folder exists and to create it, etc.  But if you use the Front Panel Control to select the destination folder, it should be okay.
    Not the best implementation, mind you but you'll get the idea..
    Message Edited by JoeLabView on 04-18-2007 03:43 PM
    Attachments:
    copy folder contents.PNG ‏10 KB

  • HT1338 How can I get my photo to work again? the app will not open on my desk top any more. I can not dave my photo on my desk top

    How can I get my photo to work again? the app will not open on my desk top any more. I can not dave my photo on my desk top

    Hello, Cubby21. 
    Thank you for using Apple Support Communities.
    Here are the best resources for troubleshooting issues with Message.
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Cheers,
    Jason H.

  • How can I get a list of active savepoints for the current session?

    Hi,
    In Oracle Applications, we are getting the following error while performing ROLLBACK to a Savepoint.
    "Unexpected Error: ORA-01086: savepoint 'PTNR_BULK_CALC_TAX_PVT' never establishe d ORA-06510: PL/SQL: unhandled user-defined exception"
    So how can I get a list of active savepoints for the current session?
    Could you please also let me know if there is any better way to debug this issue.
    Appreciate any quick response as the issue is very critical.
    Thanks,
    Soma

    user776523 wrote:
    Hi,
    In Oracle Applications, we are getting the following error while performing ROLLBACK to a Savepoint.
    "Unexpected Error: ORA-01086: savepoint 'PTNR_BULK_CALC_TAX_PVT' never establishe d ORA-06510: PL/SQL: unhandled user-defined exception"It sounds like there's an execution path in the code where the SAVEPOINT is never issued.
    There is no way to get a list of active savepoints. Is this your code or a "canned" procedure? If it is your code you can go through the code looking for answers, possibly tracing execution using DBMS_OUTPUT.PUT_LINE or writing messages to a log table. If its a "canned" procedure you may need to open an SR with Oracle

  • When I try to activate my cs 3 premium production, I get a message saying NO CONNECTION. Everything is in order though. How can I get an activatioon number other then trough the web??

    When I try to activate my cs 3 premium production, I get a message saying NO CONNECTION. Everything is in order though. How can I get an activatioon number other then trough the web??

    Sign in, activation, or connection errors | CS5.5 and later, Acrobat DC

  • When printing two-sided from my Mac on landscape A4 with 2 columns, how can I get my HP Photosmart 6520 to print the same way up?

    When printing two-sided from my Mac on landscape A4 with 2 columns, how can I get my HP Photosmart 6520 to print the same way up?

    Or, it is set the other way around (which makes more sense). Even though you are in Landscape mode, it is binding on the Long Side of the paper. Since you are in Landscape, you would want it to bind on the short side.
    Think of the Binding like a Book. How would you flip the finished pages to read the “book.” Where it would be bound in the imaginary book is how you want it to print.

  • How can i get my keyboard to be recognized by the imac?

    how can i get my keyboard to be recognized by the desktop imac?

    Hello emanson805,
    Thanks for using Apple Support Communities.
    If you need to set up your Apple Wireless Keyboard with an iMac, then please follow the directions below.  Please note that if the keyboard was previously paired with another device, you will need to unpair it before being able to pair with your iMac.
    Bluetooth: How to set up your Apple Wireless Keyboard - Apple Support
    Have a good one,
    Alex H.

  • How can I get my safari to open after installing the new Mavericks operating system?

    How can I get my safari to open after installing the new Mavericks operating system?

    Thanks Carolyn. Unfortunately, this didn't work. It turned out to be in my display monitor as I have my computer wired to my tv for streaming. Once I changed the monitor display it worked fine. Go figure

  • How can I get my iPhone to show up on the panel to the right iTunes? I keep connecting it but it does not work.

    How can I get my iPhone to show up on the panel to the right iTunes? I keep connecting it but it does not work.

    http://support.apple.com/kb/TS1538

  • How can I get my Mac to connect faster to the Internet? My wifi connection is fine....don't know why Safari and other web browsers are so slow.

    How can I get my Mac to connect faster to the Internet? My wifi connection is fine....don't know why Safari and other web browsers are so slow.

    If possible, connect to your router with Ethernet and turn off Wi-Fi. Any difference?

  • How can I get google groups mail to appear in the Mail application on my iPhone 5?

    How can I get google groups mail to appear in the Mail application on my iPhone 5?

    Try to use the SearchReset extension to reset some preferences to the default values.
    *https://addons.mozilla.org/firefox/addon/searchreset/
    Note that the SearchReset extension only runs once and then uninstalls automatically, so it won't show on the "Firefox > Add-ons" page (about:addons).
    If you do not keep changes after a restart then see:
    *http://kb.mozillazine.org/Preferences_not_saved

Maybe you are looking for

  • Possible to create java code on the fly?

    I'm just curious. I am in the process of making a bunch of custom Lightweight components which will be a part of a physics tutorial package. (Stuff like arrows, charges, fields, cars, rocks, etc.). I have some specific tutorial applets I am creating

  • How can i display more than 5 documents

    in the "Recents" section?  With the new update for IOS7 it's now only showing the last 5 docs opened.

  • Where I can find Developer 6i Patch 9

    I cannot find Developer 6i Patch 9 in metalink. Would you please tell me where I can get it? Our forms are compiled with this version and my disk is dead and I need it to reinstall development. Thanks.

  • Battery Status:   Service Battery

    I installed Snow Leopard today and I noticed that the battery menu in the upper right corner is reporting "Service Battery". I hardly use the battery (I have had it for a little over a year and I have only gone through 79 cycles). As a result, I will

  • Please add support for Tiles

    I have been looking on other lists and sites and this seems to be a big missing piece of both JSC and JSF -> the ability to template the layout of pages. As a Struts developer, I find creating page templates in Tiles, them being able to reuse, inhert