find out all the line last character and color fill

Dear friend,

I need to find all the last character and fill color of line (no need to the last character of words).

My code problem: no space in the last character is not the fill color.

My code is below:

var myDocument = app.activeDocument;  
var myLine = myDocument.stories.everyItem().lines.everyItem().getElements();  
for(i=0; i<myLine.length; i++)  
{  
    var myCon = myLine[i].texts[0].contents;  
    if(myCon.match(/\n| /gi) != null){  
        try{  
            if(myLine[i].characters.item(-2).fillColor = myDocument.colors[2]);
            }catch(e){}  
        }  
    }  

My screenshot as below:

last.png

Please suggest a friend

Thanks in advance

KS

Add a ' if else ' statement to apply the fill color to the second to the last character only if the last character is a space. otherwise apply the fill color for the last character.

myDocument var = app.activeDocument;

myLine var = myDocument.stories.everyItem ().lines.everyItem () .getElements ();

for (i = 0; i

{

Chantal var = myLine [i] .texts [0] .silence;

If (myCon.match (/ \n| IM)! = null) {}

try {}

If (myLine [i].characters.item-(1) .silence == "'" ") {}

myLine [i].characters.item-(2) .fillColor = myDocument.colors [2];

} else myLine [i].characters.item-(1) .fillColor = myDocument.colors [2];

} catch (e) {};

}

}

Tags: InDesign

Similar Questions

  • Find out all the colored text

    Hello

    In a large InDesign CS5 document without styles - how can we select all the text in a certain color and apply a paragraph style?

    :-) Nina storm

    Edition > find/replace

    To find

    Implement

    Find Format

    Select the color of character

    Format change

    Select the style.

  • Find out all the package and procedure names linked using an array of specifc

    I have 25 packages
    Each package contains 30-35 procedures
    I need to find all packages and procedures
    Each procedure handles the Tables from 5 to 20 according to the need of business rule.
    I need the entire package and related procedure names where a specific Table name is
    (DBA_SOURCE is not objective).
    Quick response appreciated.
    Thank you and best regards,

    It is difficult to help you if you do not want to read what is suggested. The utldtree.sql script will do what you want. Read the first part of the script and it will tell you what it does and how it works:

    >
    REM $Header: utldtree.sql, v 1.2 1992/10/26 16:24:44 $ RKOOI Stab
    REM
    REM Copyright (c) 1991 by Oracle Corporation
    REM NAME
    REM deptree.sql - Show objects recursively depends on given object
    REM DESCRIPTION
    REM This procedure, temp and table will allow you to see all
    Objects REM (recursively) depends on the given object.
    REM Note: you will see the objects for which you have permission.
    Examples of rem:
    REM run deptree_fill ('procedure', 'scott', 'billing');
    REM select * from deptree by seq #;
    REM
    REM Execute deptree_fill ('table', 'scott', 'emp');
    REM select * from deptree by seq #;
    REM
    REM run deptree_fill ("package body ', 'scott', 'accts_payable'");
    REM select * from deptree by seq #;
    REM
    Way prettier REM to display this information only
    REM select * from deptree by seq #;
    REM is
    REM select * from ideptree;
    REM This shows the relationship of dependence via indentation. View
    REM that no order by clause is necessary with ideptree.
    REM RETURNS

    >

    Did you notice the part that says? :

    >
    REM Execute deptree_fill ('table', 'scott', 'emp');
    REM select * from deptree by seq #;

    >
    If you supply a table name, it will display the objects that depend on this table just as you said you want.
    Please try this script.

  • When I installed firefox I lost all info of 'Favorites' that has no filter and I can't find the latest browser. Find out all the this info?

    When I installed firefox I didn't that I loose access to information of 'Favorites' that was on my old browser from microsoft. I got info really important that I can't see how to get now.

    See https://support.mozilla.org/kb/import-favorites-from-internet-explorer

  • Find out all the fmb that include a pll.

    I have a few hundreds of forms.
    And a specific library.

    Is there an easy way to quickly identify the fmb having this particular pll attached?
    I don't want to open them in Report Builder, and then click libraries and scan for my library...

    Thank you
    Toon

    Published by: Toon Koppelaars on February 16, 2010 11:13

    Toon,

    I suggest to rename your file pll and batch then recompile all your forms.

    Forms that don't compile should be those who have the attached pll.

    Or there are the forms API / ORCL Toolbox / Caffo / etc looking for tools.

  • How to extract all the drives SAS/SATA and Ethernet port speed of the link command line?

    Hello

    Do you know if supports Windows OS built in order to extract all the SAS/SATA drives and ports Ethernet link speed?

    i.e. for SATA3 drive it show 6 Gbps, for DIS3 drive it will show 12 Gbps, to present the current link speed.

    i.e. for Ethernet 10 G, it will show 10 Gbit/s while the current connection speed is at 10 Gbps.

    I need the command to create a batch file to run bike test to check all connection speeds are correct in each cycle the system power runs, if the Windows operating system does not support built in order to achieve this, please send us any tool of 3rd - party with the support of the command line to do this.

    Thanks in advance.

    Jacky

    Hello

    This is a forum for Windows and you can't find the experts here, so your question will better suit in the TechNet forum where members of the community who have the expertise to help you. Check out the link and post your query:

    https://social.technet.Microsoft.com/forums/en-us/f4a3a72b-21e4-45fc-b623-eb1d99215c79/command-prompt-and-bat-files?Forum=w7itprogeneral

  • I have the time to default iPhone 4 iOS 7.1.2 iPhone App not updated since the last 3 days and also checked all the settings for location and also set as new iPhone always present problem... Please try to fix... Thanx

    I have the time to default iPhone 4 iOS 7.1.2 iPhone App not updated since the last 3 days and also checked all the settings for location and also set as new iPhone always present problem... Please try to fix... Thanx

    Turn off your device and turn it on again. If this does not help, sign out of your account and reconnect.

    In addition, you can try to reset your settings.

    • Press and hold the sleep/wake button
    • Press and hold the Home button
    • Press and hold both buttons until the display turns off and on again with the Apple logo on the subject.

    Alternatively, you can go to settings - general - reset - Reset all settings

  • How can I get rid of the square with the time and date in which pops out all the time and also the thing aside

    Would like to know if there is a way to get this huge place with date and time to turn off my computer and also the side thingy that comes out all the time and the date and time... it is frustrating to do something on my laptop and all of a sudden here they come out and I can not do a thing until I get them to go back whence they came there at - it a path to delete or if they are not all the time I don't really care for windows 8... Windows 7 was fine with me... not sure what to do thank you for your help frustrated

    What a kind screensaver which is scheduled to start after one minute of inactivity?

    What has happened since the first day?

    Another program or process is causing the problem, what happens if check you mode safe and a clean boot to see if you can find the cause?

    How to start Windows 8 in Mode safe
    http://www.bleepingcomputer.com/tutorials/start-Windows-8-in-safe-mode/

    How to perform a clean boot for a problem in Windows Vista, Windows 7 or Windows 8
    http://support.Microsoft.com/default.aspx/KB/929135

    If you test with another Windows user, rather than your current user, you have the same problem?

    Any chance of linking to, or provide a screenshot of what you see?

    How i: post a screen shot on this forum?
    http://answers.Microsoft.com/en-us/feedback/forum/feedback_other-na/how-to-insert-images-in-MS-answers/94a5cb36-A21F-4A6A-B266-611cf6c910c8

    How can I insert a picture in a reply to a message
    http://answers.Microsoft.com/en-us/feedback/forum/user/how-do-i-insert-a-photo-into-a-reply-to-a-post/17a15382-c587-44BB-9594-c0673c8402af

  • How to filter data according to internal application and in case if returns nothing outside the query must return all the lines

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    Select * AB

    where b in (select b BC where b = "2sample")

    This query will return me 1 row, but there are cases where the value of the parameter b is null

    and that it should return all rows in the table

    as

    Select * AB

    where b in (select b BC where b = "2sample")

    which return specific values, but I want to change in a way when the inner query returns nothing then outer query should return all the lines and works as

    Select * AB;

    Is it possible to put in a single query

    Hello

    You seem to ask for different things.  You want all the lines AB when

    1. The parameter ("2sample' in the example) is NULL, or when
    2. There is no corresponding row in the 2 tables (which could happen even if the parameter is not NULL)

    ?

    Assuming you want the option 2, here's one way:

    WITH got_rnk AS

    (

    SELECT ab.*

    DENSE_RANK () (ORDER IN CASE

    WHEN b (IN)

    SELECT b

    BC.

    WHERE b = "2sample" - parameter

    )

    THEN "A".

    OF ANOTHER 'B '.

    END

    ) AS rnk

    AB

    )

    SELECT a, b

    OF got_rnk

    WHERE rnk = 1

    ;

    This does not assume b is unique in each table.

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.

  • Find all the lines from the previous column value difference lines

    I have an interesting requirement. There is a DATE column and a user in one table and I have to find all the lines for all users for which the previous and the current line has lagged in lets say more than 30 minutes. The rows are already sorted in time.

    For example in the following table, we need to ID 4 and 6 for user 1.


    Date of the user ID
    1 1 today 1 hr. 0 Min. 0 sec.
    today 2 1 1 hour 1 min 0 sec
    Today 3 1 1 hour 29 min 0 s
    * 4-1 today 1 hour 59 min 3s *.
    5 1 today 2 hours 10 min 2 sec
    * 6 1 today 2 hours 50 min 7 s *.

    Published by: user733179 on March 5, 2009 12:00

    Hello

    To obtain a separate calculation for each value of the usr, start the analytical clause with "BY usr PARTITION":

    WITH     got_dif     AS
    (
         SELECT     id,     dt,     usr
         ,     (dt - LAG (dt)
                    OVER ( PARTITION BY  usr
                              ORDER BY          dt
                            )
              )             -- difference in days
                  * 24 * 60  AS minutes_dif
         FROM     table_x
    --     WHERE     ...     -- if needed
    )
    SELECT     id,     dt,     usr
    FROM     got_dif
    WHERE     minutes_dif     > 30
    ;
    
  • I still have not found "help" to tell me how to remove all the lines and columns beyond those needed for my spreadsheet.

    I used several worksheets.  More allows me to specify the rows/columns and then delete them.  This is to remove all the lines/columns beyond those set up and formatted for my spreadsheet.   I tried many ways to remove all additional lines/columns, but without success.  I even took the time to scroll down/on to highlight all the unnecessary lines and columns, but they do not remove it.
    Any suggestions?  I used spreadsheets most allow me to specify the number of rows/columns for my worksheet

    You can ask your question in the office | Excel Forum because it is not really a problem of Windows XP performance and maintenance.

    Office | Excel

    http://answers.Microsoft.com/en-us/Office/Forum/Excel

    Also, providing specific information may help to get a faster response or better, such as the version of Office or Excel? version of Windows XP? Home, Pro, 32-bit or 64-bit.

    I hope this helps.

  • I want that my address book to view all entries by first or last name and have filled all the information accordingly.

    Original title: address book

    I want that my address book to view all entries by first or last name and have filled all the information accordingly. However, I have a mixture of the first name and the name of the list alphabetically when I scroll down tom insert name in an e-mail message. My list of contracts is organized by all the names first. How can I sync the address book to match the list of contacts?

    Hi tgblueblade,

    1. what email program are you using?

    2 are. what device or software you using Sync?

    If you use Windows contacts, then this isn't the ability to synchronize the list of Windows contacts to be identical to the list of e-mail contacts.

    Manage your contacts

    http://Windows.Microsoft.com/en-us/Windows-Vista/managing-your-contacts

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I'm retouching of images taken on my iPhone 6 more with Photoshop CS6. I'm doing my color correction and add effects and all that. Before you export the image I review and be sure to what I has no more sharpness and the lines are smooth and it looks good

    I'm retouching of images taken on my iPhone 6 more with Photoshop CS6. I'm doing my color correction and add effects and all that. Before you export the image I review and be sure to what I has no more sharpness and the lines are smooth and it looks good overall. I export it to JPEG, max quality with the establishment of reference standards. I then open the image and it seems fine, as it did in photoshop. My problems begin to occur when I try to download on Twitter as my profile picture. I tried downloading from my office directly on the site via google chrome. When I download the image then begins to have jagged edges and overlooks the tablets. So I thought it was some performance settings, then I tweaked them and restarted a couple of times and still the same result. He would go on my desk but when uploaded to twitter as my profile picture is horrible. So I tried emailing the image of myself and the download through my phone. I opened the image on my iphone and it seemed fine as he did on my desktop but when I downloaded the image it makes then look blurry. I had this problem when downloading photos Twitter via my iphone, so it doesn't surprise me. I have read different forums saying: you must download it from the office, so I thought it would work like this. This could be a problem of twitter than compresses uploaded photos? Other people can do very much the same way, but it does not work for me. Please someone help me before I put my computer in an oven microwave.

    This could be a problem of twitter than compresses uploaded photos?

    Yes. The rest, we can answer. You wrote a lot, but very little discussion. Instead of accurate information you lose yourself in the vague descriptions. Screw color management to the wrong dimensions that trigger resizing server-side it could be any number of things here.

    Mylenium

  • sum of all the lines before and the line real (11g)

    Hello
    I would like to know how to summarize the value in a column of all the lines before the actual and real. A simple example

    Select the ID of
    (
    Select rownum, 1 double ID
    Union
    Select rownum, 2 double
    Union
    Select rownum, 3 double
    Union
    Select rownum, 4 double
    Union
    Select rownum, 5 double
    Union
    Select rownum, 6 double
    Union
    Select rownum, 7 double
    )

    offers

    ID
    1
    2
    3
    4
    5
    6
    7

    and I would have

    ID SUM
    1 1
    2 3
    3 6
    4 10
    5 15
    6 21
    7 28

    Thanks for any help
    Best regards

    Hello

    Here's a way to do it:

    with t as
    (
    select rownum r ,1 ID from dual
    union
    select rownum,2 from dual
    union
    select rownum,3 from dual
    union
    select rownum,4 from dual
    union
    select rownum,5 from dual
    union
    select rownum,6 from dual
    union
    select rownum,7 from dual
    )
    select id, sum(id) over (order by id) sum
    from t ;
    
            ID        SUM
    ---------- ----------
             1          1
             2          3
             3          6
             4         10
             5         15
             6         21
             7         28
    

    Kind regards
    Sylvie

  • Disorder by displaying all the lines in the classic report

    Hello

    I have a classic report coming out data based on the variable binding element (which is a selection list). Some entries should have about 200 lines, but the page shows only 15 lines.

    I tried assign none to paging still don't see all the lines. Here is my setup for the pagination of the table: http://i.imgur.com/iQoG0.png

    If I get my pagination back, then I have the chance to see all the lines by clicking next but I need to show all the lines in the page. Is this what I need to do besides assign none to paging?

    Apex 4.1.1

    See you soon

    Hello
    >
    I have a classic report coming out data based on the variable binding element (which is a selection list). Some entries should have about 200 lines, but the page shows only 15 lines.

    I tried assign none to paging still don't see all the lines. Here is my setup for the pagination of the table: http://i.imgur.com/iQoG0.png
    >
    The question of the number of lines determines the number of lines on the page. You have set to 999, which seems correct.
    >
    If I get my pagination back, then I have the chance to see all the lines by clicking next but I need to show all the lines in the page. Is this what I need to do besides assign none to paging?
    >

    Add a paging process reset point treatment "before areas" (or anywhere before this) and you will be ok.
    The browser cache does not clear the paging alone sometimes.

    See you soon,.

Maybe you are looking for

  • Replaces Windows XP Firefox?

    With the imminent removal of support for Windows XP, I was wondering if Firefox will replace Windows XP.

  • Satellite C660-1CQ - purchase charger and the battery in another country

    About 4 years ago, I bought a laptop C660-1CQ Toshiba of the Qatar. Now I'm in India. The laptop is showing problems in charge and the battery. I want to buy a new battery and charger. But I won't be going back to the Qatar to buy it because now I am

  • batch rename files with wildcards

    How can I batch rename 100 files so that I change only the first four characters of a name of fifty character where the last 30 characters are different for each file name?  To BACK the rename command would work with wildcards, but my files names are

  • Cannot find printer / computer

    I have a HP Deskjet 3050 J611which a printer prints perfectly wireless or if the software is not installed, although it won't scan without software.  When I install the software, it works neither prints nor analyses.  What impression of the task goes

  • Wipe the Z10 Z10 security blackBerry problem

    Nice day Last night at 10:30 I started a wipe of my BlackBerry Z10 security is expected to be completed at the time wherever I woke. But it is now 1:30 and it still shows the shredder icon. Would it really just that it took 27 hours (and still ongoin