How do I select a specific word inside a TextFrame?

I want to highlight a word inside a TextFrame, but I'm only able to select the entire frame.
I have tried something (and several related version) like this:
var textFrames:com.adobe.indesign.TextFrames = activeDocument.textFrames;
  for(var i:int = 0; i < textFrames.length; i++){
  var t:com.adobe.indesign.TextFrame = textFrames.item(i);
  var texts:com.adobe.indesign.Texts = t.texts;
    for(var j:int = 0; j < texts.length; j++){
      var text:com.adobe.indesign.Text = texts.item(j);
      app.select(text);
This selects the entire content of the area, instead of just a specific word.
How do I proceed? Thanks

To clarify: I dont know which TextFrame the string is within - hence i look through all frames.
I have tried implementing the suggested ideas - mainly doc.findText() as:
app.findTextPreferences.findWhat = word;
var w:Object = doc.findText();
The problem is the findText() returns object of all types, and I cannot figure how to get it working. Below is my current solution, working like a charm, though probably not the most efficient implementation.
public static function select(word:String):void{
  var app:Application = InDesign.app;
  var activeDocument:Document = app.activeDocument;
  if (!activeDocument){
  return;
  var textFrames:com.adobe.indesign.TextFrames = activeDocument.textFrames;
  for(var i:int = 0; i < textFrames.length; i++){
  var t:com.adobe.indesign.TextFrame = textFrames.item(i);
  var words:Words = t.words;
  for(var j:int = 0; j < words.length; j++){
  var selector:Word = words.item(j);
  if(selector.contents.toString() == word){
  selector.select();
  return;

Similar Messages

  • When using a numbers spreadsheet, how do I select a specific area for printing?

    When using a numbers spreadsheet, how do I select a specific area for printing?

    Also this would be a question for the Numbers app fourm.  Not the iMac hardware fourm.

  • How to create hyperlink on one word inside a paragraph?

    I have a paragraph of text coming from the database as a CLOB, and I need to add a hyperlink to one word in the paragraph. I have done this for an entire field, but not one word inside the paragraph. Any ideas on how to do this?
    The output file is a PDF. The version of Oracle Reports is 10g.
    Thanks in advance!

    Thanks for your time Mona.
    Without modifying the Table Interface I solved my problem.
    Earlier I mentioned that the exceptions were not highlighting when created in BEx. the reason is I gave negative %  range -10 to -1000.
    But when I changed that range as -1000 to -10, It worked fine. I created the same exceptions for all the 7 queries in BEx. So all those execeptions are automatically highlighted the result in Portal.
    Cheers
    POPS

  • How to use select a vi function inside a loop?

    I am modifying the notifier basics part 2.vi to send a notifier to each of 64 sub-vi's. How can you use the 'select a vi' function inside a loop for 64 iterations to access the individual filenames??
    Attachments:
    Notifier_BASICS_Part_2.vi ‏87 KB

    If all you are trying to do is send notifiers to each of these 64 subVIs, I would suggest not doing it in a loop, but rather just placing the 64 subVIs in your diagram.
    The alternative is of course to use the call by reference node and have an array of VI names. This is a little cleaner on the diagram, but 1) doesn't occur in parallel and 2) is a bit tricky. Additionally, you have to be sure that your array of filenames is correct, and that you NEVER move or rename those VIs. Of course, you could always put them in a directory and create an array by reading the directory contents.
    Either way, good luck, it doesn't sound like fun.

  • How to move selection based on word outline?

    Hello everyone,
    I am trying to write a script for adding TAGs as comment into word document. The idea is to add a tag for every heading and sub-heading present in document. The input word documents do not have 'word style' followed. I have following two questions.
    1.) How can I extract number of headings based on outline? The document do not use word styles for adding headings or sub-headings. This makes it difficult to use 'outlineLevel' to be used. As if a heading is written in normal text then outlineLevel will
    return '10' and script will miss this heading. I read on another forum that outlineNumber can be used but it does not seem to be working with paragraph object.
    2.) How to move selection from one heading to next? Currently my script is not able to move selection.
    Below is the script I manage to write. (I'm new to scripting and this is my first script)
    $filePath = "H:\Desktop\ashishk\F1K\FunctionalSafetyCopy.docx"
    $word = New-Object -comobject word.application
    $word.visible = $false
    $MinDepth = 1
    $MaxDepth = 9
    $TagPrefix = "TS_FS_"
    $TagStart = 1
    $TagStep = 1
    $TagNew = 0
    #Document object
    $doc = $word.documents.open($filePath)
    $section = $doc.sections.item(1)
    $range = $section.Range
    $outline = $doc.Paragraphs | ForEach-Object {
    if($_.outlineLevel -le $MaxDepth){
    Write-Host "outlineLevel:" $_.outlineLevel
    if($TagNew -eq 0){
    $_.Comments.Add($range, "$TagPrefix$TagStart")
    $TagNew = $TagStart + $TagStep
    Write-Host "New Tag number:" $TagNew
    Else{
    $doc.Comments.Add($range, "$TagPrefix$TagNew")
    $TagNew = $TagNew + $TagStep
    Write-Host "New Tag number:" $TagNew
    $doc.save()
    $doc.close()
    $word.quit()

    You will need to get the selection range object and reference it as a range.  If the outline is not really an outline then how would you use it?  I think if you clarify your question it might lead you to seeing an answer.
    If it is an outline you should be able to just walk the outline.  Any outline element can have a text (10) section attached. 
    I would suggest that you start in the Word Developers forum and try to understand how this would be done in VBA or C# then translate it into PowerShell.
    I would also recommend creating this as a callable macro or function in the word doc or a template. You can then just open and call the macro from PowerShell.
    ¯\_(ツ)_/¯

  • How do I select a specific folder of photos for a slideshow on Apple TV?

    Using Apple TV 3 and Mountain Lion on Mac Mini. I am making a slide show on Apple TV. The thing is, unlike in the music function, in which I see all my playlists listed, in the Slideshow function all I see is "Photos", and the photos shown are only those from the first folder in pictures, so that is all that is available for me from which to make the slideshow. How do I use Apple TV to view all my folders of photos, so that I can select the correct folder of pictures from which to make the slideshow?

    No, sorry, that's how Migration Assistant works -- the most recent backup is the one it uses.
    Your best bet might be to restore whatever you need from that last backup somewhere else, then delete it (see Time Machine - Frequently Asked Question #12), so the last backup is the one you want.

  • How do you select multiple / separate words in Pages?

    Hi, I currently have Pages 5.5 (2109)
    and the title is self-explanatory.
    I'm trying to shift over from Microsoft Word, but this one function seems not to be at present.
    Can somebody help me?
    If it does not exist, is there any way you can dictate it?
    Thank you,
    Henry

    Use Pages '09.
    Peter

  • How do I save a specific layer as an audio file

    I needed a second audio file and created a layer and placed my video file that has the audio I want in that layer.  I edited the audio in that layer and now I want to save the result as an audio file.. preferably an MP3 file. How do I select a specific layer and save just that layer as an audio file?

    I would think  with Photoshop you may be able to save it as a video mp4 file then find a Video splitter program to split out the audio.  Or use and Audio program in the first place rather the using a program like photoshop that can do some basic video editing.

  • How do you export a specific audio segment in timeline

    I recently tried to reduce noise from a specific clip by exporting a short segment of my audio to create a file I can use with audacity. I ended up exporting the entire audio segment of the project.
    How can I select a specific clip segment that is only a part of the video and export it to create a file I can then edit using audacity?
    I would like to avoid exporting the entire event clip from which that segment came. I have done considerable editing of the original video footage in the event and trying to figure out where that segment came from would require a considerable amount of time.
    Any help or guidance is appreciated.

    in fcpx 10.0.6, if you have a range selection, the export will be only that segment.
    Hold down the R key and click-drag a range selection, or use the playhead to mark In ('i' key) and Out ('o' key) points.
    Select Share > Export File
    In the dialog, select Settings
    For Format: Audio Only
    Audio File Format: I recommend AIFF, CAF or WAVE (depending on your target audio editor.) [AAC, AC3, and MP3 are "delivery" formats, not editing formats.]
    then hit Next and save it.
    I recommend setting a marker at the in point so you can easily line up the edited audio when you re-import it.

  • How do you find a table that doesn't have a specific word in it.

    I have two questions.
    questions 1
    How do you find a table that doesn't have a specific word in it by using a query on the whole database?
    questions 2
    How would i list all of my cars names in my database not showing duplicates?
    I have tried, tried and tried some more to get both of these, but I guess i don't know how to query a specific word.
    I also don't know how to query everything in just 1 column name.
    If anyone could help with these that would be great I have been trying queries for over an hour now and no luck.
    Thanks

    798837 wrote:
    I tried the all_tab_columns, just like you did it, however that just gives me the column name I am looking for what is not in a column.
    For example I need to find all the tables where mustang is not = 'red' but using a single query i need to find all of the tables.
    As for number 2
    I am looking for something like this
    select distinct column_name
    from all_tab_columns
    where column_name ='AcertainColumn';Now I'm even more confused. In your example, is MUSTANG a column name? Or is it the value of a MODEL column in the CARS table? And how could that possibly relate to something that exists in multiple tables?
    If your data model is at all reasonable, I would expect that you would just want
    SELECT *
      FROM cars
    WHERE model = 'Mustang'
       AND color != 'Red'but I can't see how this would relate to data stored in multiple tables.
    Justin

  • How to select a specific column in a bean method?

    Hey everyone,
    I'm trying to select a specific column in my adf table so i can hightlight the ones i can after, with a method bean that does a match from another table. I'm using JDeveloper 12.1.2.0.0.
    Here's my table at the moment (its a static list that Timo and Alejandro helped me create, thanks to them again!):
    <af:table value="#{bindings.Anos1.collectionModel}" var="row"
                                                              rows="#{bindings.Anos1.rangeSize}"
                                                              emptyText="#{bindings.Anos1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                              rowBandingInterval="0" fetchSize="#{bindings.Anos1.rangeSize}"
                                                              filterModel="#{bindings.Anos1Query.queryDescriptor}"
                                                              queryListener="#{bindings.Anos1Query.processQuery}"
                                                              filterVisible="false" varStatus="vs" id="t5"
                                                              styleClass="AFStretchWidth" columnSelection="multiple"
                                                              inlineStyle="max-width:100%;" columnStretching="multiple"
                                                              columnSelectionListener="#{ControlBean.onAnoColumnSelect}"
                                                              disableColumnReordering="true"
                                                              binding="#{ControlBean.dimAnos}">
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2011.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2011"
                                                                   id="c54" width="16%">
                                                            <af:outputText value="#{row.A2011}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2011.tooltip}"
                                                                           id="ot54">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2011.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2012.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2012"
                                                                   id="c55" width="16%">
                                                            <af:outputText value="#{row.A2012}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2012.tooltip}"
                                                                           id="ot55">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2012.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2013.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2013"
                                                                   id="c56" width="16%">
                                                            <af:outputText value="#{row.A2013}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2013.tooltip}"
                                                                           id="ot56">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2013.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                    </af:table>
    I've deleted some of the columns because they are all equal and by doing so, you have less problems in reading it.
    In my method i have a matchEm but i'm trying to select a column by using this line:
            dimAnos.setColumnSelection("A2012");
    dimAnos is the binding for my table Anos (Years in Portuguese). I even tried another values fro the columnSelection but i couldn't make it selected. Am i doing anything wrong?
    Please help me or give me an idea of how can i do this.
    Regards,
    Frederico.

    Hi Frederico,
    The method setColumnSelection is meant to set whether your table supports column selection or not. It doesn't select the column. In order to select the column, you need to set the column attribute Selected to true. So I don't know if its an option for you but you can create a binding to all the columns you have in you bean, and then call the method A2012.setSelected(true), and then add a partial target to the table to re render it and show the selected column.
    Hope this helps

  • How to find a specific word in sentence in each line?

    How to find a specific word in sentence in each line and output will show start from the beginning from specific word plus with small description from each sentence?
    For example: I need to find a "+Wednesday+" and "+Thursday+" word in each sentence by line by line from "myfile.txt".
    Go ballet class next Wednesday.
    On the Wednesday is going to swim class.
    We have a meeting on Thursday at Panda's.
    Then it will show the output:
    Wednesday : ballet class
    Wednesday : swim class
    Thursday: meeting at Panda's
    I am going to figure out in Java console to read from a file for specific word from each line and how to make it output in correct way. I know already to make input/file codes.

    I got it and understand much better. Thank you very much. There is a problem with it because I knew how to make
    a specific word in sentence but how I should make Output for specific word and some words from sentence.
    For example:
    Input:
    +"On Thursday go to ballet class"+
    +"Swim class on Friday one time a month at 2 p.m."+
    I used the codes for that:
    class FindSchedule{
         String firstline = "On Thursday go to ballet class ";
         String secondline = "Swim class on Friday one time a month ";
         FindSchedule(){
              System.out.println(firstline + findTheIndex("Thursday", firstline));
              System.out.println(secondline + findTheIndex("Friday", secondline));
         public int findTheIndex(String word, String sentence){
              int index;
              index = sentence.indexOf(word);
              return index;
         public static void main (String[] args){
              new FindSchedule();
    }The output will be:
    Thursday: ballet class
    Friday: 14:00 swim class one time a week
    Notice that time is changing in output complete different from input.
    I need to find out how to extract some words from each sentence for output. Do you know how to do it?

  • How to highlight specific words in the Reader

    Hi!
    I am new to the Acrobat SDK and could need some guidance on how to solve the following problem:
    I need a plug-in that is able to highlight specific words in a pdf file (e.g. by underlining it or changing the background color) and offers a context menu with futher actions when the user clicks on a highlighted word. The first step would be searching the text to find the word that should be marked. I think that should not be that hard but how can I highlight specific words? I first thought of annotations but I need it in the Reader and I should not change the pdf file itself (just the view of it).
    The idea is similar to the skype plug-in for Firefox or IE. The skype plug-in highlights phone numbers. We need to highlight specific words.
    Thanks for every hint on how to achieve this!
    Fabian

    >The documentation says that AVPageViewHilightText is supposed to use >the current color set with AVPageViewSetColor - so it should work. >What version of Acrobat are you working with?
    Yes that how understood the documentation too. I tried the following:
    //Define red
    red.space = PDDeviceRGB;
    red.value[0] = ASInt32ToFixed(1);
    red.value[1] = 0;
    red.value[2] = 0;
    // highlight
    AVPageViewSetColor(pageView, &red);
    PDTextSelect pdTextSelect = PDDocCreateTextSelect(pdDoc, pageNum, &bbox);
    AVPageViewHighlightText(pageView, pdTextSelect);
    I am using Acrobat 7.0.9.
    >Drawing an image would be done with AVPageViewDrawCosObj
    >- which means you'll need to bring the image in as a PDF
    > object and then render it.
    Oh I should have seen that. Thanks for the hint!!
    >Interesting, there should be a way to get transparency,
    > but I am not seeing it at the moment.
    As far as I understood it, it is possible to set the color to transparent but thats not what I am looking for. I would like to have a way of changing the alpha channel of the color.
    Thanks!
    Fabian

  • How do I search for a specific word in the code using Dreamweaver?

    I need to search for a specific word in the code for all of my website pages. How can I do that using Dreamweaver?

    To search local files of a Defined Site in DW...
    Open the Find & Replace tool with Ctrl + F
    Change the Find In dropdown to Entire Current Local Site
    Change the Search dropdown to Text or Source code
    Add the text to find in the Find field
    Add the text to replace in the Replace field (or nothing if you just want to delete the text)
    Hit Replace All

  • How to: Select a Specific Timeline Displayed in Project Online when having multiple timelines within the Enterprise Project

    Currently I have an Enterprise Project which has 6 custom timelines and I want to know how to select a specific timeline to be displayed on the Project specific SharePoint site.
    I'll provide some background for you so you understand my issues... I have created a "template" project with 6 custom timelines. From that project I created multiple new projects - which they all have the 6 custom timelines. These projects are
    all stored in the Project Center. The problem I am having is I don't understand how to select a specific timeline to show on the project specific SharePoint site. They all seem to be displaying 1 of the 6 timelines (in no particular order). I was thinking
    maybe if I had edited a project and saved it while it was displaying a specific timeline it would display the last selected timeline on the SharePoint site, but it doesn't seem to be doing that.
    Is there a way to select a specific timeline to display on the SharePoint site?  Also, is there a way for a user to cycle through the numerous timeline view on the project specific SharePoint site?
    I await your help!! :)

    Michelle_Sm --
    I ran into this problem at the company where I used to work.  One of our PMs had created multiple Timeline views, and wanted a specific custom Timeline view to show up in the Project Site for that project.  I could not see any way to make that
    happen.  We had one of our SharePoint developers look into the issue, and he could not see any way to make this happen either.  So, I am thinking this is not possible to do.  But I would gladly welcome others in this forum to tell us the trick,
    if there is one!  :)  Hope this helps.
    Dale A. Howard [MVP]

Maybe you are looking for

  • Remote desktop results in blank screen.

    So I have my mac mini (the core2duo) running OSX 10.6.4. For video it's connected to my stereo (via HDMI) which in turn is connected to my TV via HDMI. No problems so far with this. However. Let's say my TV and Stereo are off and I want to remote des

  • XPath question

    I am trying to populate an accordion using an XML document as follows: <?xml version="1.0" encoding="iso-8859-1"?> <images xmlns=" http://www.g-raff.com/images"> <groups> <group groupname="Martyn's favourites"> <image> <filename>atomic-kitten-1.jpg</

  • NULL SID Security Log Event ID 4625 when attempting logon to 2008 R2 Remote Desktop Session Host

    This is a new deployment of Server 2008 R2 in a newly created 08 R2 active directory on a newlyt installed 08 R2 RDSH server. A new generic user is created in AD. That user can log on to the terminal server on the console just fine. But that user can

  • Automatic Sleep solved

    Hope this helps someone For several weeks the G4 would not go to sleep automatically per the settings in the energy saver pane. Trashing plists and other remedies suggested in this forum did no good. I could put the Mac to sleep without problems incl

  • [Solved] UEFI. System hangs on boot after successfully activating swap

    Alright. Unnecessary Background: I've been using Arch for years. I just bought a stupidly good computer with a bunch of specs that I don't think are relevant, except for the fact that I am using an X99-pro. It has RAID support, but I am not using tha