Insert or replace last content

HI Forum,
I do need a little tweak on this script...
Thing is, i want to find the last paragraph, last line, last character and make it as full stop...
eg.
•   can do anything if you need;  (";" to replace with ".").
it is doing that,,,
but if there is no ";" or ":" it is replacing the character d....
I want check the last character is ";" or ":" and to replace with "."
if there is no ";" or ":" just add "." at the end..
myDoc = app.activeDocument;
app.findGrepPreferences = null;
app.findGrepPreferences.bulletsAndNumberingListType = ListType.BULLET_LIST;
var myResults = app.findGrep();
var oDoc = app.activeDocument;
for(n=0; n< myResults.length;n++){
var fnd = myResults[n].paragraphs.lastItem().lines.lastItem();
               if(fnd.insertionPoints.itemByRange(-3,-2).contents !== "."){
               fnd.insertionPoints.itemByRange(-3,-2).contents = "."
alert(fnd.insertionPoints.itemByRange(-3,-2).contents)
Many thanks...

Sorry Vam for the confusion...
this is what i mentioned....
for(n=0; n< myResults.length;n++){
var fnd = myResults[n].paragraphs.lastItem().lines.lastItem();
               if(fnd.insertionPoints.itemByRange(-3,-2).contents !== "."){  // if there is a paragraph below the bullet paragraph, it works fine... if not it replaces the last character with"."
               fnd.insertionPoints.itemByRange(-3,-2).contents = "."
alert(fnd.insertionPoints.itemByRange(-3,-2).contents)
eg. • vamitul;
      • vamitul;
      • vamitul;                      // now the semicolon  of the last paragraph will be replaced with "."  itemByRange(-3,-2).
Dummy text paragraph of this what when dummy text. (paragraph below the last bullet).
eg2. • vamitul;
        • vamitul;
        • vamitul;
        • vamitul;    // if there is no paragraph below...  now character "l" is replaced with "." itemByRan(-3,-2) goes to l and change it......
Again sorry if im confusing..... vam..

Similar Messages

  • Problem with "Insert" and "Overwrite Sequence Content"

    I'm working with XDCAM footage. I like to take all the individual clips recorded on the XDCAM disc, and after getting them into FCP, taking them and putting them all in a sequence in FCP, then using that sequence as the source in the Viewer. This allows for quick scanning of all the clips, much as is it were a digitized tape.
    I recently found the "Insert Sequence Content" and "Overwrite Sequence Content" commands in FCP, and like them in that they actually put the individual clips into my project timeline, and not just the combined sequence (which looks more or less like a nest when dropped into my project sequence).
    Here's the problem: When I put IN and OUT points in the timeline, and "Insert or Overwrite Sequence Content" using the sequence containing all the clips, the video tends to be contained to between the IN and OUT points I set in the TIMELINE, but the audio tracks tend to expand past the OUT point I set in the TIMELINE, and I can't figure out why, or how to get around this.
    Any assistance would be appreciated.

    If you're inserting or overwriting, you're basically pasting the content that you've chosen. I wouldn't think the out point would be recognized, or even wanted. If you copied 5 minutes of clips and inserted it into a sequence with a 4 minute in/out point duration, do you want to only have the first 4 minutes inserted into the sequence? If you only place an in point, it will insert all the clips, starting at that point, and it will take up as much time as the clip content's duration.
    Am I missing something here?

  • When i go to insert a arrow in my movie for a highlight film instead of saying picture in picture it only says insert or replace how do i get it to say picture in picture?

    how do i get the picture in picture to show up instead of insert or replace.

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • I want to sync the songs on my Mac to my iPod, but it says An iPod can be synced with only one iTunes library at a time. Erasing and syncing replaces the contents of this iPod with the contents of this iTunes library.' Will this reset my iPod completely?

    I want to sync the songs on my Mac to my iPod, but it says, 'An iPod can only be synced to one iTunes Library at a time. Erasing and syncing replaces the contents of this iTunes Library.' Will this reset my iPod completely (my iPod is 4th gen)?

    Was your iPod associated with a different mac or pc previously is all. And was it backed up or sync'd on this mac with iTunes previously.
    http://www.apple.com/support/itunes

  • Trying to sync new music i got on my mac which is my new computer to my iPhone and erase and sync is saying it will replace the contents of my phone. Does it mean Photos also or just Music and Videos?

    I got a Mac and i downloaded new music on it and im trying to sync the music on this computer to my iPhone which is hooked up to another iTunes and iTunes is saying " An iPhone can be synced with only one iTunes Library at a time. Erasing and syncing replaces the contents of this iPhone with the contents of this iPhone with the contents of this iTunes library" does this mean that it will also erase my photos or just my music and videos ?? if it does is there another way to sync with out all my contents being deleted??

    You can only sync one iTunes Library from Mac to iPhone.
    And just so are you aware, Apple ID accounts cannot be merged, thus merging content > Frequently asked questions about Apple ID

  • Insert or Replace from Clipboard?

    Is there a way to insert or replace a VI from the clipboard?  Or maybe a quick drop plugin to do this?
    Is it possible to do with a quick drop plugin?
    I ran into a situation earlier where I needed to insert a simple VI to a number of wires in different cases.  The VI was named in a way that made it a little tedious to find in quick drop over and over, but if I could have inserted it from the clipboard I could have knocked out the task in just a few seconds.
    I just want to make sure I'm not over looking anything before I tackle writing my first QD plug in or suggesting it on the idea exchange.

    Wart wrote:
    That doesn't handle inserting it into existing wires though.  Or replacing existing VIs with the one on the clipboard.  For the sake of completion I use Ctrl+C/Ctrl+V with VIs all the time
    Something I just discovered as a reasonable workaround is to copy and paste the VI name from the Quick Drop dialog box.. Then I can Ctrl+Space, Ctrl+V, Ctrl+I to insert.  I'd like to eliminate a key stroke combo, but that's at least reasonable.  I could follow the same process with Ctrl+P at the end to replace an existing VI.
    Have you used the Findand Replace? It will search and replace VIs for you. Yes, the Ctrl-V does not replace an existing VI or insert it into existing wires.
    BTW, you might want to kudo this idea.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • My hard drive was replaced last week.  The geek squad from Best Buy backed up all my information prior to replacing the hard drive.  they reinstalled everything on the new hard drive including iTunes.  When I opened I tunes, my playlists were missing

    My hard drive was replaced last week on my macbook pro.  The geek squad from Best Buy backed up all my information prior to replacing the hard drive.  They reinstalled everything on the new hard drive including iTunes.  When I opened I tunes, i had some but not all my songs listed.  All my playlists and purchases were missing.  I attempted to sync my iPod so my playlist and information would be reinstalled but iTunes does not recognize the iPod to allow it to sync.

    Hello Boylen33,
    I was very disappointed to read about your experience when taking your phone in to the Geek Squad for service. I agree with avm5689, purchasing the Geek Squad Protection plan is a great way to protect your investment in a product that is so necessary to our everyday lives. The agent should have known exactly what steps to make the exchange an easy, and smooth process, and I sincerely apologize for the frustrating experience you received instead. 
    I assure you every single post on the forum from our customers is of utmost importance to us, and we are always happy to help in anyway we can. As per the terms and conditions of your Geek Squad Protection plan, you should receive one battery per the life of the plan, and you can order it simply by calling our Partstore. As I mentioned previously, this is something the Geek Squad agent should have explained to you, or as the mobile specialist did, call them for you, and I'm truly sorry this wasn't handled in that manner causing you to waste a lot of time at the store.  Using the e-mail you registered on the forum, I was able to locate the service order, and I will be documenting your experience for further training opportunities.
    Once again, I am very sorry for any disappointment this has caused, and I appreciate very much you bringing this to our attention. I hope you will give us another in chance to offer you a much better experience.
    Respectfully,
    Maria|Social Media Specialist | Best Buy® Corporate
     Private Message

  • I synced my iPhone to my husband's computer and it wiped out his iTunes account replacing his content with the content of my iTunes account. Any idea how to fix this?

    I synced my iPhone to my husband's computer not knowing that it would wipe out his iTunes account and replace his content with mine. Obviously, not good. Any ideas on how to fix this??

    Syncing an iphone should have no effect at all on the content of the computer.
    Are you saying the the itunes library on the computer was effected?

  • Replace Attributes Content ?

    Is there a FCPX equivelant to Replace Attributes > Content?
    I have several plaeholder clips with all atributes set on my timeline. Now I need to replace them with different media, but want to retain cropping, timing, in and outs, etc.
    I know I can copy atributes and paste them into a new clip, but this doesn't transfer the in and out points. Any ideas?

    Not as selective as the old Final Cut, but you can select a clip and copy it, then go to:
    Edit > Paste Attributes (or similar - FCP X is shut down at the moment).
    As I say, you get the lot, but it's better than nothing.
    Andy

  • Replace last comma with ' and '

    Hi All,
    please let me know is there any simple way of replacing last comma in as string with ' and '
    eg: 1.  abc,xyz,wuv should be returned abc,xyz and wuv
         2. abc,wuv should be returned abc and wuv
         3. abc,pqr,cuq,wuv should be returned abc ,pqr,cuq and wuv
    DB version : 11.2.0.3
    Thanks,
    DS

    With only SUBSTR and INSTR:
    <LQS with sample_data as ( select 'abc,xyz,wuv' str  from dual union
      2                        select 'abc,wuv' from dual union
      3                        select 'abc,pqr,cuq,wuv' from dual
      4                      )
      5  --
      6  -- actual query
      7  --
      8  select str
      9  ,      substr(str, 1, instr(str, ',', -1)-1)||' and '||substr(str, instr(str, ',', -1)+1)
    10  from   sample_data;
    STR             SUBSTR(STR,1,INSTR(STR,',',-1)-1)||
    abc,pqr,cuq,wuv abc,pqr,cuq and wuv
    abc,wuv         abc and wuv
    abc,xyz,wuv     abc,xyz and wuv
    3 rows selected.

  • Replace last delimeter with "and" in a string in SSRS

    Hi,
    I want to replace last delimeter (comma) with and 
    in a string in SSRS 2008 R2.
    if there are more than one unit, and the Area of the units are different, then the area of each must must be listed separated by commas and ‘and’ before the last one.
    i.e.,
    Input string- Hi,Hello,HRU,
    Desired output- Hi,Hello and 
    HRU..
    how can I achieve this (and
    before last word) ?
    (suggest in SSRS or even in SQL)
    Rgds/-

    Your example seems to indicate you wish to substitute "and" for the second to last delimiter and ".." for the last. Is that the ask? Will there actually be a trailing delimiter on the input string?
    This can be done several ways: In the dataset, in an expression, using custom code.
    The approach for the dataset and expression are similar, just the language is different. Dataset will usually deliver better performance since the source is often a more powerful server (in the case of a SQL dataset).
    In an SSRS expression it might look like this:
    =Left(Fields!InputString.Value,InStrRev(Fields!InputString.Value,",")-1)+" and "+Right(Fields!InputString.Value,Len(Fields!InputString.Value)-InStrRev(Fields!InputString.Value,","))
    This assumes the input string is actually a field from your dataset but it could be anything. The Left piece gets the string that occurs before the last comma without the comma, then append " and ", then the Right expression gets everything after the last
    comma and appends it. If you will have a trailing delimiter, you could substitute the following formula anywhere you see Fields!InputString.Value:
    =Replace(Trim(Replace(Fields!InputString.Value,","," "))," ",",")
    Because Trim in an SSRS expression only trims leading and trailing spaces, the delimiters must be converted to a space. So this only works if there are no spaces in the original string. If the input is "Hi,Hello,How are you," the result of this formula will
    be "Hi,Hello,How,are,you" because the spaces between How, are and you will get replaced by ",". To handle embedded spaces makes the expression more complex. Assuming the input string is "Hi,Hello,How are you,":
    =Replace(Replace(Trim(Replace(Replace(Fields!InputString.Value," ","|"),","," "))," ",","),"|"," ")
    This expression uses 2 more replace statements. The innermost statement substitues "|" for the embedded spaces so they don't get replace with ",". You should use a character that you are sure will not appear in the string otherwise. Or use a sequence of
    characters like "|^|" that you are sure won't appear if any one character may possibly appear. The outermost Replace restores the "|" characters back to spaces.
    A code solution may be easier. Just wrap the below in a simple function:
    return str.Trim(",".ToCharArray()).Substring(0, str.Trim(",".ToCharArray()).LastIndexOf(",") - 1) + " and " + str.Trim(",".ToCharArray()).Substring(str.Trim(",".ToCharArray()).LastIndexOf(",") + 1);
    This is the VB.Net equivalent of the expressions above.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Scripting problem replacing layer contents.

    This is a follow up to the discussion in this thread http://forums.adobe.com/thread/480444?tstart=0.
    I've virtually completed the script, I attached it as a .txt file rather than .jsx , In a brief nutshell it does the following:
    Gets a text file name.
    opens the psd identified in that document
    walks the layers in that file
         if the layer is a text file and there is replacement text for that name in the input file, replace the text
         if the layer is an image (NORMAL) and there is an input file with a name (.jpg or .psd) matching the layer name then
               the layer is turned into a smart object and it's contents replaced with the contents of the relevant file.
    Saves the modified psd file as the name indicated in the input file and close the original file.
    If the input file indicates the file should be left open, reopen the modified file name.
    Almost everything works well except ...
    1. Sometimes the modified file loses it's layering and winds up with only a "background" layer whereas other times it retains it's layering. I'm sure this is due to some characteristic of the input template .psd, but with limited understanding of photoshop itself I've no idea what characteristic to look for.
    Any suggestions as to what might be the source of this problem?
    2. It appears that sometimes when creating the 1 layer file that will replace an image layer as a .jpg it losses the background transparency. This doesn't seem to happen if saved as a .psd, but the user wants to work with jpgs.
    Any ideas why?
    3. When replacing an image layer from another replacement file, the resulting new image in the modified file doesn't seem to be properly aligned. Incidentally, the same behaviour occurs if I do the steps of creating a smart layer and replacing manually in photoshop. I tried to attached the .psd files but the forum would not allow it.
    Again any ideas why it might be misaligned or a code change that will fix it?
    Any suggestions would be most thankfully accepted.
    Steve Ellis.

    3. When replacing an image layer from another replacement file, the resulting new image in the modified file doesn't seem to be properly aligned. Incidentally, the same behaviour occurs if I do the steps of creating a smart layer and replacing manually in photoshop. I tried to attached the .psd files but the forum would not allow it.
    Again any ideas why it might be misaligned or a code change that will fix it
    When a file is placed, you set the size and position in the layer. When you replace the contents the same transform values are used. If the file used to replace is not the same size as the first, it will not be the same size and location in the layer. I don't know of any way to determine the transform or reset it. The script could resize but that would require opening the file, resizing, and saving before the replace.
    I created the .psd file with which to replace the image layer from the image layer of the original by changing the image and saving it. I then checked the image size, canvas size, and transform values of both and they matched. When I ran the program the replaced image was misplaced, too high in the new psd. I then editing the replacing file and changing the y transform value until it resulted in the right place when placed by the script. For it to work properly the y transform value of the replacing layer was approximately 100 more than the replaced layer (I assume this particular value will vary with the particulars of the files). This is what confuses me, when they were identical it didn't work properly.

  • HT4527 How can move the apps and playlists on my iPad to my Mac? Whenever I attempt to sync, I get a message stating that all apps and music on my iPad will be replaced by content from my Mac and there are no content. Thanks.

    How can move the apps and playlists on my iPad to my Mac? Whenever I attempt to sync, I get a message stating that all apps and music on my iPad will be replaced by content from my Mac and there are no content. Thanks.

    the apps will not be deleted if the itunes is authorised for the apple id from which you downloaded the apps.
    for the songs if you have downloaded it from a store other than itunes an app "TuneAid" will help you. download the full version then you can copy all the songs on the ipad to ur itunes library

  • Replace last occurrence of a word in string

    Hi,
    I need to replace a last occurrence of a word in string. Form example:
    'I like fruits and also like vegetables'  need to replace last occurrence of "like" which is just before vegetables and not the "like" before the fruits.

    One of the solution to use the last occurrence dynamically
    applicable to prior version of 11g
    SELECT REGEXP_REPLACE (str, 'like', 'hate', INSTR (str, 'like', -1))
      FROM (SELECT 'I like fruits and also like vegetables also like mango' str FROM DUAL)
    applicable to 11g
    SELECT REGEXP_REPLACE (str, 'like', 'hate', 1, REGEXP_COUNT (str, 'like'), 'i') data_col
      FROM (SELECT 'I like fruits and also like vegetables also like mango' str FROM DUAL)

  • TOC. Insert page. TOC contents is on page 1. Upon export it is last page ??

    Hi again,
    I am using a set of tutorials that outline how to create my ePub TOC.
    I used this method successfully for my last ebook.
    This time, I am subdividing my TOC.
    The TOC links are NOT Chronologically based by the chapter sequence
    but based upon a Subject.
    A fictional TOC example follows.
    Locations
        Alaska
        Hawaii
        California
        Maine
    Time periods
        1700s
        1800s
        1900s
        2000s
    PROBLEM.
    I needed to add or rather insert a page at the very beginning of my document (page 2) so that I could physically type in the TOC Contents as above.
    Layout > pages > insert pages > insert after page 2.
    When I export this....
    The TOC Contents is the very last page of the ePub.
    But in my inDesign Document it is on page 1.
    QUESTION 1.
    Can someone explain this please  ?
    Thanks again.
    I have the Indesign 800+ page PDF but there is not anything on TOC.
    Thanks again.

    It probably has something to do with how your text boxes are connected in InDesign. You need to put the table of contents in the "flow" of the book.

Maybe you are looking for

  • CF Mapping not working on linux

    We installed CF8 on linux, and my app ran fine. Then *something* happened, and now CF mappings are not getting recognised. I am not the admin for the box, and unfortunately there was a delay betwen it getting broken and me being able to look into it.

  • Missing File error when trying to install HP 5610xi using Windows 7 64 bit download

    I have tried several times to download and install the software and drivers for my old 5610xi on my new computer running Windows 7 Home Premium 64-bit OS. I keep getting a "missing file" message when trying to run the download, and it will not instal

  • Jumpy Apple TV

    I have MacBook Air and have been using Apple TV with i with no problem until a recent update for Apple TV. Now the picture and sound jump every few seconds and its not a streaming issue. can anyone help? I have tried restarting.

  • Do I have to use certificates when writing an HTTPS server

    I'm writing a client app and a server app. The client will connect to the server via HTTPS. A browser will never connect to this HTTPS server, just the client I have written. Can I skip the step of using certificates? I've been told it isn't a requir

  • How to merge static pdf files and dynamic livecycle forms

    Hello, I was wondering if there was a way to merge static pdf pages with a dynamic livecycle form to create one file. Thanks, -vargs