How can I alternate character colors with code CS3 JS-need for eye excersize?!

For an interesting attempt to train eye focusing, I need to write code or find a tip to color every other character in any given file.
Still an amatuer in Scripting.
ST

Select a text frame and run the script. Don't choose a frame with great number of characters if you don't want to wait until tomorrow morning.
var myDocument = app.activeDocument;
var myColorCounter = 0;
var myColors = [];
var myColorsValues  = [
                      [100, 0, 0, 0],
                      [80, 0, 100, 0],
                      [0, 0, 100, 0],
                      [100, 60, 0, 0],
                      [0, 100, 100, 0],
                      [60, 100, 0, 0],
                      [0, 44, 96, 0]
CheckSwatches();
// Select a text frame
var myTextFrame = myDocument.selection[0];
var myCharacters = myTextFrame.characters;
for (i = 0; i < myCharacters.length; i++) {
    myCharacters[i].fillColor = myColors[myColorCounter]
    ResetSwatches();
ResetSwatches();
function CheckSwatches() {
    for (i=0; i<myColorsValues.length; i++)  {
        var myCurArray = myColorsValues[i];
        var myColorName = "C=" + myCurArray[0] + " M=" + myCurArray[1] +  " Y=" + myCurArray[2] + " K=" + myCurArray[3];
        if (myDocument.swatches.item(myColorName) == null){
            var myCurColor = myDocument.colors.add({colorValue:myCurArray, name:myColorName});
            myColors.push(myCurColor);
        else {
            myColors.push(myDocument.colors.item(myColorName));
function ResetSwatches() {
    if (myColorCounter < myColorsValues.length-1) {
        myColorCounter++;
    else {
        myColorCounter = 0;

Similar Messages

  • How can i control background colors with items (registry.dat)

    Hello Evry one.....
    plzzzzzzzzz help.
    how can i control background colors with display items
    in registry.dat
    like app.ui.requiredFieldvABGCOLOR=255.0.0
    how can i control background colors with others items ????
    thanks.

    The iPhone has a "remote" app that lets you control Keynote on a Mac, but not on another iOS device (iPhone/iPad/iPod Touch).
    There are some apps that let you control limited content on another iOS device - but the content has to be within the app. You might check out SyncPad - perhaps you can import the presentation into it and then control it on the iPad.

  • How can I use the color adjustments interface that shows up for camera RAW on jpeg files?

    How can I use the color adjustments interface that shows up for camera raw on other files types? The HLS controls had the secondary color adjustments (6 colors instead of the 3). Plus, it had same vibrancy and a better Curves interface. Yesterday was the first time I imported raw into Photoshop CS5 and I got that really cool interface. What is that? Can I use that on other file formats?

    Actually I am using the Tradional Chinese Version, when I try to edit the jpg file with camera raw, the system shows that there is no camera raw plug-in. The cmaera raw never work.

  • How can I authorise a mac with 11.1.3 iTunes for my phone

    how can I authorise a mac with 11.1.3 iTunes for my phone

    Authorization
    Macs:  iTunes Store- About authorization and deauthorization.
    Windows: How to Authorize or Deauthorize iTunes | PCWorld.
    In iTunes you use the Authorize This Computer or De-authorize This Computer option under the Store menu in iTunes' menubar. For Windows use the ALT-S keys to access it. Or turn on Windows 7 and 8 iTunes menus: iTunes- Turning on iTunes menus in Windows 8 and 7.

  • I can't download the apps with big size like need for spees, but in apps with normal size(less than 100KB)there is no problem,is there any body who can help me?

    I can't download the apps with big size like need for spees

    Have a little patience. 4 minutes is only a short time for someone to find your post and reply to it. Also clicking on "This Solved My Problem" marks your problem as solved so many folks that may otherwise help will pass the question by since it is "solved."
    I suggest you start a new question that gives a good title to a specific problem. Then in the body of the thread describe the problem in detail, tell us what steps you have tried so far to correct the problem, what happened, and what error messages you received.

  • How can I replace a color with a pattern fill?

    Hi everyone, thanks for any responses in advance!
    I've created quite a detailed design that works with 4 pixels per cm and 16 colors, canvas size 120x170cm. I'm wanting to replace all of a single color with a pattern, is there a way to do this?
    I can replace a color with another flat color by using adjustments etc... but I want to fill the entire of one color area with a pattern instead. The only way I can think to do this would be to use the magic wand tool to select every pixel of the same color, then create a new layer and overlay with a fill of the desired pattern, however as the design is so detailed it would take me an awful long time to select each color!
    Can anyone suggest a quicker more efficiant way to do this?
    Thanks!

    Select --> Color Range
    Mylenium

  • How can I use a microphone with a wireless speaker system for announcing at a party?

    I am trying to use my computer (which is already wirelessly hooked up to my speakers) as a make shift pa system. Is there a way to hook up a microphone to my computer to use it to do a little announcing at a party?

    NI-DAQ is not supposed to detect your GPIB and NI-488 software will not detect your daq board. When you installed MAX, was this from a LabVIEW driver install CD that also put a new version of NI-DAQ on your pc. Open MAX and check your currently installed versions of NI-DAQ and NI-488. They should both be listed. If you have a new version of NI-DAQ than 6.1, you can uninstall the newer version and install 6.1.

  • TS4006 i just bought a ipad. it is been charge on the table (in a hair salon). i am busy with the customer, when i came back, the ipad has been stolen. I did not set up the ipad yet. how can i find the ipad with the icloud. i need some help, please.

     

    Welcome to the Apple Community.
    Unfortunately you can only enable Find my Phone while you have the device, I'm afraid there isn't anything you can do now.

  • How can I discover a color saturation in an image?

    My name is Eduardo, from São Paulo/Brazil. I'd like know how can I discover a color saturation in an image? For example, I open an image in photoshop CS6 and I'd like to know what a color is more saturated for after to do a treatment with color balance. I tried to use a Color Sample Tool in Photoshop, tried to find some articles and techiques on Google, but without success.
    Somebody help me?

    Hi Eduardo,
    Try looking at the Color window.  You can find this by going to Window -> Color.  In the Color window, you can use the eyedropper to select a color and see the color information displayed.  See the screenshot. 
    Hope this helps!

  • Array of clusters and in the cluster is a bar meter, how can I change the color individually?

    Array of clusters and in the cluster is a bar meter, how can I change the color of the bar meter individually for each element of the array?  I have just figured out that you can't change properties of one element of the array without all elements changing.  For the scaling I had to make numeric indicators for each tick of the scale so that each bar meter in the clustered array would have individual scales.  I also had to do some math to scale each barmeter to display correct proportions from 0 to 100%.  Now I'm stumped on the color of the bar meter.  Basically, if the value goes over a setpoint, the bar meter needs to turn red.  It has to be in an array to be infinitely scalable.
    Thanks
    Matt
    Solved!
    Go to Solution.

    You can't do that-
    without a little trick.
    You could consider laying a custom color box over the bar graph in the cluster you can set the color based on the value of the bar graph or even make a "Pseudo"- bar graph using a series of color boxes stacked to look lie a bar and changing values of the Color boxs from empty to full to red.
    Here is an example to demonstrate
    Jeff
    Attachments:
    Pseudo bar.vi ‏12 KB

  • HT5622 How can I find out my security code?

    How can I find out my security code?

    Look around for the slip of appear you wrote it down on when you created the code. No one here can help you discover what code you are talking about.

  • How can i see number of T code which to assinged to perticular user with di

    Dear All,
    How can i see number of T code which to assinged to perticular user with discription.
    Which report i have to be execute with T code.
    reply me.
    Thanks,
    Regards,
    sachin

    Hi
    Try transaction S_BCE_68001426, or repor RSUSR010 (The Same)
    Regards
    Morten Nielsen

  • How can I get Multi-color text it a swing componet?

    How can I get Multi-color text it a swing componet?
    I've tryed JTextPane and JEditorPane.
    If they support having text in more then one color then I don't see how.
    I want to make a color-coded Java editor in Java, but I can't color-code if I can only have one color.
    JComponent.setForeground(Color fg)
    is not what I need.
    maybe Java doesn't support it yet.
    but I hope it does.
    Please help, thanks.

    Hi,
    I've made you a little example with a coloured JEditorPane and JTextPane:
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ColorDemo extends JFrame {
         public ColorDemo() {
              super("ColorDemo");
              // coloured JEditorPane
              JEditorPane editorPane = new JEditorPane("text/html",
                   "<FONT color=red> This </FONT>"+
                   "<FONT color=blue> is </FONT>"+
                   "<FONT color=green> a </FONT>"+
                   "<B> JEditorPane </B>");
              editorPane.setPreferredSize(new Dimension(250, 150));
              // coloured JTextPane
              JTextPane textPane = new JTextPane();
              textPane.setPreferredSize(new Dimension(250, 150));
              Document doc = textPane.getDocument();
              Style def = StyleContext.getDefaultStyleContext().
                   getStyle(StyleContext.DEFAULT_STYLE);
              try {
                   StyleConstants.setForeground(def, Color.blue);
                   doc.insertString (0, "This ", def);
                   StyleConstants.setForeground(def, Color.red);
                   doc.insertString (5, "is ", def);
                   StyleConstants.setForeground(def, Color.green);
                   doc.insertString (8, "a ", def);
                   StyleConstants.setBold(def, true);
                   StyleConstants.setForeground(def, Color.black);
                   doc.insertString (10, "JTextPane", def);
              } catch (Exception e) {}
              JPanel contentPane = new JPanel();
              contentPane.add(textPane);
              contentPane.add(editorPane);
              setContentPane(contentPane);
         public static void main(String[] args) {
              JFrame frame = new ColorDemo();
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.pack();
              frame.setVisible(true);
    }Hope this helps,
    Kurt.

  • How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)

    Hello,
    Here is the problematic:
    1° How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)
    - I've many button in a doc im creating
    - the color of the buttons is white with black stoke & black text
    - in roll over state i want them to inverse the color coding (the text white & bottom black)
    - currently the text becomes invisible as black on black cant be seen (ive stroked it white but that looks ugly)
    - i would just like to know if there is a function made for this?
    My other questions:
    2° Ive a presentation on which Ive created buttons which tigger pop-up animations
    - i have 5 buttons which trigger animations
    - the viewer can chose to Click on any of the buttons randomly
    - the problem is once the animation is open how can it be close... either:
    a) by it self after "40" seconds
    b) when ther viewer clicks another button
    3° Ive created buttons linking pages..
    - "go to page xxx"
    - when i do a preview and click on the buttons the links dont take me to the right pages
    - is that normal? (maybe in preview its suppose to be like that)
    4° I would like to intergrate YouTube videos in the presentation so they play inside the docment.. when i tried.. it said the 'link isnt a flash video'
    - what should i do?
    5° Once i export it into Swf. how how can i visualize it? or put it online?
    Thank you for your time.

    stlbbl4u wrote:
    Hello,
    Here is the problematic:
    1° How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)
    - I've many button in a doc im creating
    - the color of the buttons is white with black stoke & black text
    - in roll over state i want them to inverse the color coding (the text white & bottom black)
    - currently the text becomes invisible as black on black cant be seen (ive stroked it white but that looks ugly)
    - i would just like to know if there is a function made for this?
    You should setup Object Styles - these can also include Paragarph Styles that can be triggered when the Style is selected.
    http://help.adobe.com/en_US/indesign/cs/using/WS5CEDB81A-0011-4dc9-9DE8-AC7AD4C80076a.html
    My other questions:
    2° Ive a presentation on which Ive created buttons which tigger pop-up animations
    - i have 5 buttons which trigger animations
    - the viewer can chose to Click on any of the buttons randomly
    - the problem is once the animation is open how can it be close... either:
    a) by it self after "40" seconds
    b) when ther viewer clicks another button
    I'm not sure what you mean - I don't do files with Animations
    3° Ive created buttons linking pages..- "go to page xxx"
    - when i do a preview and click on the buttons the links dont take me to the right pages
    - is that normal? (maybe in preview its suppose to be like that)
    Does it work properly when you export it to the finished file?
    4° I would like to intergrate YouTube videos in the presentation so they play inside the docment.. when i tried.. it said the 'link isnt a flash video'- what should i do?
    InDesign won't link directly to youtube videos. I think your best bet would be to use Downloader to download the video and embed them directly in Indesign.
    5° Once i export it into Swf. how how can i visualize it? or put it online? 
    Thank you for your time.
    You can look up how to embed a SWF file into your HTML - but it depends what you mean by "online" there's a dozen ways to get a file "online".

  • How can I return multiple values with PL/SQL Web Services

    Hi,
    I'm new to developping Web Services. I'm doing some tests with JDeveloper and OC4J on my local machine with a Web Services based on a PL/SQL function within a package. Right now that function only returns one value. So the xml response only has one output.
    I'd like to know how can I return multiple values with my PL/SQL Web Service. For example, if I want to return an employee's name and id? And that the xml contains two output : <employee>, <empid>?
    Reginald
    ps : I have searched the forum and I couldn't find an answer to this question, if that has been discussed AND answered before, can you please post the link? Thanks

    Alright, I actually found my answer. Since this was asked I think as a followup somewhere else I'll give my answer.
    It is very simple, all you have to do is create an Object Type and then Return that object type. After that, JDeveloper will take care of everything and you will have an xml response with multiple values. Here
    {color:#ff0000}
    create or replace TYPE person AS OBJECT
    ( id_interv number,
    first_name VARCHAR2(50),
    last_name VARCHAR2(50),
    date_birth date
    );{color}
    Then your function used in your Web Service should look something like this :
    {color:#ff0000}
    function info_emp (p_empno IN VARCHAR2) RETURN person AS
    l_emp person := person(-1,'','','');
    BEGIN
    SELECT first_name
    ,last_name
    ,emp_no
    INTO l_emp.first_name
    ,l_emp.last_name
    ,l_emp.emp_no
    FROM emp
    WHERE upper(emp_no) = upper (emp_no);
    {color}
    {color:#ff0000}
    RETURN l_emp;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    l_emp := person (-1,'n/a','n/a','n/a');
    RETURN l_emp ;
    END info_emp;{color}
    {color:#ff0000}{color:#000000}After that, this is what the xml response looks like :{color}{color}
    &lt;first_name xsi:type="xsd:string"&gt;John&lt;/first_name&gt;
    &lt;last_name xsi:type="xsd:string"&gt;Doe&lt;/last_name&gt;
    &lt;emp_no xsi:type="xsd:string"&gt;0250193&lt;/emp_no&gt;

Maybe you are looking for

  • How to include a font in the installer?

    Hi all! My program uses a custom font (namely popular NI7seg font) that I would like to include in my installation distribution. I am using LabView 8.5 and I have tried force the installer (normally through the options window) to copy the font into [

  • Getting the field value of a clicked on pie slice in a pie chart?

    I have tried and searched for hours and can not get this simple little thing to work. I have a pie chart with the following event handler: itemClick="chart_click(event)" The pie series comes from a simple httpservice that has a country and a count: <

  • CS6 Photoshop [EXTREMELY] slow, help?

    Greetings, fellow users of the Adobe Community My name is Mark and currently I am studying in the Netherlands (whereas I live in) and I am following an education that revolves around Creative Suite 6, making use of programs such as Photoshop and Illu

  • How do I transfer my subscription for Ps CS6 to Ps CC ?

    I have Ps CS6 installed and pay the monthly subscription fee. I have now installed Ps CC and would like to transfer my subscription to Ps CC. Is this possible? Thanks in advance.

  • Apple TV 2 won't load library - Homeshare issue?

    I have two Apple TV2s that link into my iTunes library held on my PC. Until recently both worked very well, but following the recent update, neither will pick up the library and load it.  The Apple TV can see the library, but when I try to load it, i