Find text from current insertion point - indesign cs3 javascript

Hi all,
I need to find the text from the insertion point in CS3 document through javascipt. Built in indesign has this feature. I want to do this in my script.
Anybody have the idea/solutions for ths...
Thanks,
Vaasu

Thanks csm_phil for your interest... see my below code:
if(app.documents.length>0)
    myDoc=app.activeDocument;
    var myFoundchar=new Array();
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    app.findGrepPreferences=     NothingEnum.nothing;
    app.findGrepPreferences.fontStyle="Italic"
    app.findGrepPreferences.findWhat ="[\\l\\u].+?( v\. ).+" //"(.+?(v\.).+)";
var myResults = myDoc.findGrep();
for (var i = 0; i < myResults.length; i++)
        alert(myResults[i].contents);
    app.findGrepPreferences=     NothingEnum.nothing;
    app.findGrepPreferences.findWhat =", \\d{1,}.+?\\d{4}?\\) ";
    var mySearch = myDoc.findGrep();
    app.select(mySearch[0].insertionPoints[0]);
    alert(mySearch[0].contents);
    app.findGrepPreferences = null;
alert("Done");
here i am trying the fetch the Table of cases, example find results are
Sears, Roebuck & Co. v. Camp, 124 N.J. Eq. 403, 407 (E. & A. 1938)
Sears, Roebuck & Co. v. Camp, 124 N.J. Eq. 403, 408 (E. & A. 1938)
Gramatan Nat’l Bank & Trust Co. v. Backman, 30 N.J. Super. 349 (App. Div. 1954)
So, the 2nd search mysearch always giving first line output above.           , 124 N.J. Eq. 403, 407 (E. & A. 1938)
If i use the  mySearch[i].contents sometimes it doesn't give the correct result. Since, if gives if other than the case name ends with , and digits. It makes the result totally wrong.
Thanks,
vaasu

Similar Messages

  • Problems Copying Text from Word 2008 to InDesign CS3

    When I copy/paste text from Word into InDesign, the text pastes as an image. If I draw a text box in InDeign and paste the text in there, the same thing happens and the box is locked in position. I'm pretty sure there is a setting in Word I have to change, but I've tried everything! Any suggestions? Thanks in advance!

    Why don't you try File > Place and place the .doc file? (Probably not too many Word experts in an Adobe forum.)

  • How do you change size of text cursor or 'insertion point' in adobe cc for mac?

    how do you change size of text cursor or 'insertion point' in adobe ID cc for mac?  I have looked everywhere.  It's possible in Windows and Word but not in Mac.  Please help.  I spend half my time trying to find that blinking upright bar.

    Thanks for your note but it’s still a skinny rod that seems to disappear.  Why can’t it become a little thicker so it doesn’t disappear no matter what size I have set the screen?  My poor old eyes aren’t what they used to be.  I do appreciate your answering and I’ll enlarge the screen so the blankety-blankety blinking rod is at least visible.  Nancy
    how do you change size of text cursor or 'insertion point' in adobe cc for mac?
    created by Peter Spier in InDesign - View the full discussion
    Cursor size is governed by the type size and will be be larger or smaller on screen depending on how close you are zoomed in.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6729964#6729964
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Applescript to get the current insertion point of the cursor

    How do I use Applescript to get the current insertion point of the cursor in a Apple pages.app document?

    Oops, missed that one - you are correct, the line should be:
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">set {TheStart, TheEnd} to character range of the selection</pre>
    I have a wrapper script that I use to insert stuff from my handler/code library into a Script Editor document, and was adapting snippets from that for my examples - I guess that one got away.
    As for the dictionary, some applications just have poorly written or outdated documentation. Some of the items have multiple entries (eg, there may be a selection object for the application and also for the document), and some inherit properties from other items. Some are used as nouns, others as verbs (or both). Sometimes it is easier to visualize the item by keeping track of it's reference - the 'some property of document 1 of the current application' thing. You can use the Script Editor's Event Log to see the results of various properties and commands - for example, the above script will result in the following entry (your numbers will vary depending on the selected text):
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">tell current application
    get character range of selection
    {50, 50}
    end tell
    </pre>
    You can also use the 'log' statement (eg, 'log MyVariable') to add your own entries into the log instead of using dialog boxes.

  • How to get text from column  labels in pivot using javascript?

    Hi, is it possible to get text from column labels in pivot using javascript? How?

    You don't get a response from a URLRequest, you get the response from a URLLoader:
    View this sample page for URLRequest and URLLoader and I think it'll make more sense to you.
    http://help.adobe.com/en_US/air/reference/html/flash/net/URLRequest.html#URLRequest()

  • Can't paste text anymore from Acrobat Pro to Indesign CS3

    Since upgrading to Acrobat Pro, I can't copy and paste text into Indesign CS3 or 4 which is included in pdfs as NOTES. I can, however, copy and paste the regular content in the Acrobat document. After I copy the text from the notes, I go to paste it into Indesign and all I get is a blinking cursor. I can copy and paste from Acrobat 7. Any suggestions would be greatly appreciated.

    I've seen no solutions to this issue thus far. I will post my solutions to this issue here and on the other thread I found with the same problem.
    Here's how I resolved the issue. In InDesign under Preferences go to:
    Clipboard Handling>"When Pasting Text and Tables from Other Applications"/Paste: (and choose the "all information" option)
    If you have the "Text Only" option selected, this might be the issue. After checking "All Information" my issue was resolved.

  • How to copy Chinese text from MS Word to Indesign CS5.5

    Hello, I am a beginner and wanted to simply copy Chinese characters from MS WOrd to indesign CS 5.5. But it showed up in indesign as a bunch of squares. ANyone knows how to do it right? Thanks

    Joel Cherney wrote:
    If you cannot find any of these, the InDesign installation disk comes with a bunch of free high quality fonts, courtesy of Adobe.
    Use those.
    The chances are quite small that you will offend your Chinese readership by setting text in an overtly Japanese font like Mincho or Kozuka - but the chance is a non-zero chance. All the right glyphs are there, of course (thank you Unihan), but typographic standards differ between the two languages, and there's no sense in taking the risk.
    Ah -- apologies! Wait, let me check my ID ... I got
    * Apple LiGothic, Apple LiSung (installed by default on OS X)
    * BiauKai (umm, don't know)
    * Adobe Fan Heiti
    * STHeiti
    * LiHei Pro
    * LiSong Pro
    * Adobe Ming Std
    * Adobe Fangsong Std
    * GB18030Bitmap (exactly what it says: a bitmap font, and you can use it in InDesign! A bad idea...)
    * Hei
    * Heiti SC
    * Adobe Heiti Std
    * Hiragino Sans GB
    * Kai
    * Adobe Kaiti Std
    * Adobe Song Std
    .. and yet even more. If you are working on Windows, you get a couple of "MS Xxx" fonts as well, and in that case you are definitely better off with Adobe's set.
    I must admit I only see the difference because Japanese fonts usually do not include a "full" set of glyphs (at least, not the "usual" 3,000 to 10,000). Joel, care to point out some tell-tale glyph forms?

  • Place text from Word 2004 into ID CS3

    I was using Pagemaker 7 for a newsletter for the past few years and was placing Word documents with tags for various text styles.  These imported and were set in the tagged styles and no changes in text format were necessary.  I have now not been able to place the files into PM7 as it says there are no filters found for the operation.  I assume this is from updating the Word 2004.  I have moved the newsletter template to IDI have tried to do the same thing into a newsletter template in ID CS3 but it doesn't seem to work.  I don't know if the tags are correct, if there is a problem in my selection or if it can't be done in ID which for all the bells and whistles is a step backwards from PM7.  Could someone please help with this?  Thank you

    Just figured a bit out that seems to work.  You are right about the plain text.  I saved the file in "Text Edit" as .txt.  You are also right in that the first line needs to describe the format.  That works with<ASCII-MAC>.  Using this, I placed the document into ID just as it was exported. Also there needs to be a <ParaStyle:Normal> in the blank lines between paragraphs to hold the proper space otherwise that space is determined by the size of the text preceeding the space.  Now if we can make it work with Word saved as .txt then things will be a great deal simpler.
    <ASCII-MAC>
    <ParaStyle:Headline>If you haven’t been in the museum lately, you should come in and see our Museum Gallery.
    <ParaStyle:Normal> 
    <ParaStyle:Subhead 1>We now have on exhibit a number of Portraits from our collection. 
    <ParaStyle:Normal>
    <ParaStyle:Subhead 2>Some we can identify but there are more that we can’t. 
    <ParaStyle:Normal>
    <ParaStyle:Personal>Perhaps you would recognize someone in the portrait.  We would love to have the information.  We have many new and exciting changes in the museum.  There is new paint everywhere.  Still a lot to do but much has been done.  It is so much brighter and cleaner appearing.
    <ParaStyle:Normal>
    <ParaStyle:Caption>I like working in the museum to help with the setup of new exhibits.  We have one now on Main Street that contains a number of hats and some history of hats. I love doing the research for the exhibits and finding much information that I didn’t know before.  I enjoy helping visitors with their research also.  It is very rewarding to be able too help people find things from our files.  We have a lot of history in the museum.
    <ParaStyle:Normal>
    <ParaStyle:Caption>We have many artifacts and the collection is constantly growing.  We have a large collection of 45 records, 78 records, old wire recordings and wax music rolls.  There is a large collection of clothes and many hats, both men’s and women’s, from many time periods.
    <ParaStyle:Normal>
    <ParaStyle:NSText>I enjoy working with the Community Service people.  They have been so  much help.  We could not have made the progress that we have without them.  Come and see for yourself and enjoy the experience that I have enjoyed.  See ya there!
    <ParaStyle:Normal>
    <ParaStyle:Signature>Gwen Winter
    Museum Assistant
    This is a sample of the tags that worked saved in a .txt file

  • How can I make a pdf from a frame in Indesign CS3

    Is it possible to make a pdf-file from a selected frame in a Indesign-document?
    Way, way back we were able to do this in Quark Xpress by using a plugin.
    Is there a plugin like this available for Indesign (CS3) ?
    Help would be very much appreciated.

    http://www.automatication.com/selection-to-pdf-script.html
    Harbs
    http://www.in-tools.com

  • [JS CS5] Accessing an inline frame from an insertion point

    Given an insertion point, how can I determine if it contains an inline/anchored frame? And if so, how do I reference the inline/anchored frame?
    I know how to reference the surrounding paragraph, characters, etc., but can't figure out how to get to the inline/anchored graphic.
    I normally would just loop through all the inline graphics in the document, but it this case I need to access the inlines via their insertion points.

    As far as I know, Insertion point can't hold inline/anchored object, but character does.
    If you select text and run this line
    alert(app.selection[0].pageItems.length);
    it will return number of anchor/inline objects inside selected text.
    Another way is to check parent of object. Parent of anchor/inline object is always character.
    Example script that copies all anchor/inline objects to new layer: http://bit.ly/aV9WMF
    Hope that helps.
    Marijan (tomaxxi)
    http://indisnip.wordpress.com/
    http://inditip.wordpress.com/

  • InDesign cs3 javascript to duplicate layer

    Greetings, I'm looking for an example javascript that duplicates an indesign cs3 layer, renames the new layer that gets duplicated and turns printing off on the original layer. Any help is appreciated. Wil

    Hi Wil,
    Try the following code:
    var myDoc = app.activeDocument;
    var myLayer = "Sample"; //Add your layer name here
    var NewLayer = myDoc.layers.item(myLayer).duplicate();
    myDoc.layers.item(myLayer).visible = false;
    NewLayer.name = "SampleNew";
    I think this will solve your problem.
    Regards,
    Ramkumar

  • Find text from a file and set it as a variable in applescript?

    I am trying to build a script that sends me updates and notifications from cex.io. Please keep on reading below, so I may guide you until the point I have trouble with.
    The first simple script in this operation goes to cex.io's trading page for BTC/GHS. It records ands saves the text to a file every 4 seconds. It works great. It doesn't need to have safari refresh because the site pushes info to the browser live.
      repeat
              set the webpage_content to ""
              tell application "Safari" to set the webpage_content to the text of document 1
              set theText to webpage_content
              set a to "Macintosh HD:Users:PRIVATE:Desktop:CEX:"
              set theFile to (open for access file ((a) & "CEXRaw") with write permission)
              write theText to theFile
              close access theFile
              delay 4
      end repeat
    And it returns this from the site to this main file every 4 seconds: (note I cut off a chunk from the bottom and the top of the file, because they are unimportant)
        GHS:
        0.05233439
        BTC:
        0.00000223
        NMC:
        0.00002939
        LTC:
        0.00000000
        GHS/BTC
        0.02362958 LTC/BTC
        0.02438131 NMC/BTC
        0.00597565 GHS/NMC
        3.96951800 BF1/BTC
        1.67000000 Fund Account
        GHS/BTC
        Last price:
        0.02362958
        Daily change:
        -0.00018042
        Today's open:
        0.02381000
        24h volume:
        73812.35539255
    I now need an applescript to read that file, and return wanted values. But I'm lost on how to write it.
    It needs to find the number under BTC, and set it as a variable.
    It needs to find the number under GHS, and set it as a variable.
    It needs to find the number under Last Price, and set it as a variable.
    If anyone could script that really quick for me, or tell me how to do it, that would be amazing. Thank you so much!

    Couldn't tell if you had any whitespace in the lines (i.e. is there a space before or after GHS:), so I used contains, not is.  Also, if you have a line such as GHS/BTC with a colon GHS/BTC:  then it will also fail (as contains "BTC:" would be true for BTC: and GHS/BTC:)
    However, this will give you some guidance:
    set a to "Macintosh HD:Users:PRIVATE:Desktop:CEX:CEXRaw"
    set x to 0
    set Names to paragraphs of (read file a)
    repeat with nextLine in Names
              set x to x + 1
              if nextLine contains "BTC:" then
                        set BTC to item (x + 1) of Names
              else if nextLine contains "GHS:" then
                        set GHS to item (x + 1) of Names
              else if nextLine contains "Last Price:" then
                        set lastPrice to item (x + 1) of Names
              end if
    end repeat

  • Missing Required Parameter 'from' for event 'open' -- InDesign CS3 Error

    Now that I've upgraded to OS 10.6, and I'm getting this weird error message (Missing Required Parameter 'from' for event 'open') when I open CERTAIN InDesign files by double-clicking on the icon. Other files open okay. Everything SEEMS to open okay when I open CS3 and go to FILE and OPEN.
    Anyone else having this problem? Any advice?

    I was having this problem too and then noticed that the files that would not open had special characters in the name, # or % for example.
    I changed the name to exclude these characters and they all opened just fine.
    If that doesn't work, it may be, if you use it, Suitcase Fusion. Extensis says that if your computer name is too long or also has special characters in it that it could be a problem in OSX 10.5 and later. Go into System Preferences/Sharing and edit your name to within 20 simple characters.
    I hope this helps.
    Message was edited by: Dyrian

  • Search Text and Replace with Graphic InDesign CS3

    I will be working with an XML file to be reformatted in InDesign.
    Is there a plug-in or a way to global replace a character (e.g. "$") present in various places in the body text with a tiff image of similar size?
    Or is it possible for a web programmer to set it up so that when I import the XML file that InDesign will ask to re-link all occurrences with a graphic that I can specify?

    Place the graphic in your InDesign document. Copy it to the clipboard.
    Use find change and fill in the find field and click the flyout for the
    change field. Select ohter> clipboard contents unformatted.
    Bob

  • Is it possible to link text from Pages into an InDesign document [as you can with Google docs]?

    In InDesign, you can get a plug-in [word flow] which allows you to link the text in a Google Docs document into an InDesign document, so that you can edit the text in Google Docs [on your computer/tablet etc] and it will update in the InDesign document. Additionally, if you edit the text in teh InDesign docuemnt, the Google Docs file is also updated.
    Is there a plug-in for Pages? Or a way to do this [without ditching Pages and starting to use Google Docs]?
    Thanks

    There are no plugins for Pages for iOS. Period.

Maybe you are looking for

  • For loop in a scriptlet tag style

    For loops in a a XML style JSP tags won't work. Please have a look at the following code snippets: Works: <% for (int i = 0; i < 5; i++) {   out.print(i); %> Works: <jsp:scriptlet> int i = true; while (i) {   out.print(i);   i = false; </jsp:scriptle

  • Std SAP report which shows Ordinary vs. Special Depr by Asset

    Hi Friends ,                 Can some one tell me if there is any std SAP report in FI_AA whihc gives Ordinary vs. Special Depr by Asset . Any inputs greatly appreciated, Ty.

  • Need to group & sum items & sub items into one record

    I'm having an issue creating a report that can group & sum similar items together (I know in some ways, the requirement doesn't make sense, but it's what the client wants). I have a table of items (i.e. products).  In some cases, items can be compone

  • What is the Reader X update frequency?

    I've noticed on various Windows machines that Reader X's (10.1+) update frequency is pretty leisurly--weeks can go by after an update is released. I have Reader set to update automatically in its preferences, but the update service is on manual and n

  • BC4J - Transaction level Validations

    I need to introduce in my software some Transaction Level Validations (like an order mus have at least 1 detail, or a company must have 1 and only 1 president). Where can I put this kind of "validations" in the BC4J Framework ? TIA Tullio