[CS5.5] [JS] how to get the object that is anchored by a text search result?

Hello

I need to get the object that is anchored by a text search result. It can be an image, textframe, group objects...

It's my code...

app.findTextPreferences = NothingEnum.nothing;

app.findTextPreferences.findWhat = "< FFFC > ';

var myResults = app.activeDocument.findText ();

var currentParagrapfNum = - 1;

for (var n = 0; n < myResults.length; n ++) {}

var currentResult = myResults [n];

currentParagrapfNum = currentResult.paragraphs [0] .index;

var currentAnchoredObject =? ;

currentAnchoredObject.anchoredObjectSettings.horizontalReferencePoint = AnchoredRelativeTo.TEXT_FRAME;

currentAnchoredObject.anchoredObjectSettings.verticalReferencePoint = VerticallyRelativeTo.LINE_BASELINE

}

Can someone help me please?

Thanx

Yes, true, ^ anchor of finds, but they are of type character. What you need is

myResults[n].pageItems[0].anchoredObjectSettings.horizontalReferencePoint = AnchoredRelativeTo.TEXT_FRAME;

Peter

Tags: InDesign

Similar Questions

  • How to get the bar display of title in pixels text length?

    Hello

    Does anyone know how to get the length of the title bar text (in pixels) display?  Just to clarify, that's what I'm looking for:

    I don't see a CVI function for this.  The attribute ATTR_TITLE_FONT for GetPanelAttribute (...) is only valid for the panels of the child which prevents me from using the GetTextDisplaySize (...) to get the size.  Dive into the Windows SDK I can not even find an answer here.  Any ideas?  Thank you.

    Figured out how to do this.  Go to the SDK to get the font properties - is kind of nonobviousness.  But once you have the font properties, you can create a font of meta in CVI, with properties, and once you have the meta font you can use GetTextDisplaySize (...) to get the size.  For any future reference:

    //define a NONCLIENTMETRICS structureNONCLIENTMETRICS ncmtest;//We have to set the cbSize parameter to the size of the passed structure before retrieving it
    ncmtest.cbSize = sizeof(NONCLIENTMETRICS);
    //Get NONCLIENTMETRICS structure
    result = SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncmtest, 0);
    
    //copy the title font name to a c-string
    while(ncmtest.lfCaptionFont.lfFaceName[i] != 0)
    {
        thefont[i] = (char)ncmtest.lfCaptionFont.lfFaceName[i];
        ++i;
    }
    
    //null terminate
    thefont[i] = '\0';
    
    //create meta font with title font properties.  lfWeight & 0x700 indicates bold.  CreateMetaFontWithCharacterSet() doesn't recognize DEFAULT_CHARSET so we replace it with VAL_NATIVE_CHARSET(?).
    uir_status = CreateMetaFontWithCharacterSet ("TheTitleFont", thefont, abs(ncmtest.lfCaptionFont.lfHeight), ncmtest.lfCaptionFont.lfWeight & 0x700 ? 1 : 0, ncmtest.lfCaptionFont.lfItalic, ncmtest.lfCaptionFont.lfUnderline, ncmtest.lfCaptionFont.lfStrikeOut, 0, ncmtest.lfCaptionFont.lfCharSet == DEFAULT_CHARSET ? VAL_NATIVE_CHARSET : ncmtest.lfCaptionFont.lfCharSet);
    
    //get titlebar text
    uir_status = GetPanelAttribute (panelhandle, ATTR_TITLE, thetext);
    //get title bar length
    uir_status = GetTextDisplaySize (thetext, "TheTitleFont", &height, &width);
    

    I have a 79 for the duration of the screenshot above.

  • How to get the message that API to a new version were supported once it is released?

    Hi all

    For my work, I do my Intigration of based on the API of the latest version. So I need to be reminded, when a new version is available.

    How could I get the message that a new version APIs were supported as soon as it is released?

    Thank you

    Biao

    All the ads around API will be done through Code it.  Going forward, if/when a new API (or the version of the existing API) is released in the form of GA, it will be announced the Code it along with appropriate documentation.

  • How to choose the object that others will line up to?

    Hi I'm attacking with Illustrator, having been familiar with CorelDRAW X 5, and some of the fundamental things in artificial intelligence are just weird!

    A common operation is to have a bunch of stuff I want to align, where I spent the time of positioning on the particular object so I want that everything stays aligned him to this object. I can do it in artificial intelligence?

    For example, I have two rectangles A and B, separated horizontally with a greater than B. I want that the upper edge of the B to align to the top edge. I select A, then B and align top. It works - B moves upward.

    However if I want albums edge to align the top edge of the B, it does not work how I expect. B always moves. It doesn't matter if I choose first or second, B is the one who moves, when A is above B.

    It's frustrating when I have a lot of objects that are carefully aligned, and I want to align a new object with them. What often happens is that all of my objects placed move to align with the Unplaced object, so I spend a lot of time.

    Y at - it a simple way to choose the object that others in the choice of align on? In CorelDraw, it's the last selected object that determines how many others will be moved.

    Thank you

    Rob

    Select all the objects you want to align, and then click again on the object of the selection you want that all the others will match (object key).

    the key of the object will appear thicker than others.

  • How to get the object request or session in action jpf in WebLogic Portal 8.1

    I am using WebLogic Portal 8.1. I want to get the parameters of query/attributes in the flow (jpf) page controller action method. Can someone help me how to get objects session or request to the page (CCP) flow control.

    getRequest() (inherited method gives extended request)
    ScopedServletUtils.getOuterRequest (scopedRequest) gives the main query

  • How to get the object all save as Png adobe Illustrator

    Hello

    I'm trying to save as adobe illustrator .ai file .png file

    but all the object in different png files is that poosible

    If possible can someone help me...

    var f = new File ("C:\\test.txt");
    f.Open ("a");

    Len = app.activeDocument.pageItems.length;

    for (i = 0; i<>
    {
    c = App.activeDocument.pathItems [i] .visibleBounds;

    f.writeln (c);
    }

    f.Close ();

  • How to get the game that require a resolution of 1024 x 768 to work on my book?

    Hello

    How can I get the games requiring work of resolution 1024 x 768 on booklet?
    Any solution for this?

    Thank you

    Hello

    I assume you mean on the Libretto W100.
    The device supports a 16:9 screen with a resolution of 1024 x 600.
    If unfortunately 1024 x 768 is not supported

  • How to get the ValueObject that represents a row in a DataGrid, attached screenshot

    DataGrid.jpeg

    Hello

    I'm displaying the data in the DataGrid control by using the dataField and dataProvider as ArrayCollection collection attributes.

    It's my value object representing a row of DataGrid


    public class User
    {

    public var UName:String;
    public var Pwd:String;
    }


    On the clcik on the line in the DataGrid control, I am able to go read the elements of the cell using DatagridId.selectedItem.UName.

    Is it possible to get all of the user object that represents this line.
    I'm sorry, that if the issue is not comprehensible, here basically I want to get the whole VO of this line in the DataGrid control.

    Thanks in advnace

    Hi Kiran,

    Try to use something like below...

    var userVO: User = DatagridId.selectedItem as a user;

    Thank you

    Jean Claude

  • E4X: How to get the items that contain a string pattern in the name of the node?

    Is there a way to retrieve the children of an XMLList where the name of the node of a child contains a template string?

    For example:

    account <>

    < XblahX / >

    < cow / >

    < YblahY / >

    < / recording >

    How to get items in folder which has a node name that contains the string "blah"?

    var rec: XML =

    ;

    var r: RegExp = / blah /;
    var elems:XMLList = rec.children (). (localName () *.search (r) >-1);
    trace (elems. ToXmlString())

  • How to get the message that I want to display only.

    Hello

    I use in my main power system which is connected with different instruments as a data logger, GSM, GPS...

    In my main vi all the Subvi electrical system, gsm etc. are interconnected.

    I would like to make a few changes,

    for example when I run my vi It should seems to jump to the top of msg as of course do your power supply works.

    and if assume that its not on then display the pop up msg that your power supply is turned off, then system must be turned off, means no need to continue the operation.

    Here I am attaching my vi, I did a logic in which concerns, in that when I run my main vi I get msg to make sure that the power supply works.

    but when the power supply is off, and then I got error msg like your power supply is turned off and after clicking ok error vi is open I don't want, that all the I have attached here.

    I want only msg that your power supply is turned off and then the system must be disabled, nothing more.

    you please guide me that this King of the changes that I needed to do this.

    Thank you much in advance.

    HIII, I thank you for your time.

    Finally, I got solved.i need to make only small cahnges in this stop button in any loop.here as an attachment, I put this solution.

  • [JS] [CC] how to get the last visible character in a saturated text block?

    Hello

    I am new to InDesign scripting in javascript. I would like to know if there is a way to get the position of the last character in a text frame that is busy? I need this because I want to calculate the number of characters is hidden (overflow text) via the script.

    I looked in the forums about this, but I think it is always a script to alert if there is too much text or not.

    I'd appreciate any help!

    Well, let's say myFrame is a flowing text block.

    Thus, the last character in this context would be

    myFrame.characters-[1];

    To calculate the number of characters to spill, select the

    framework text overflow and run this script:

    myFrame = app.selection [0];

    myParentStory = myFrame.parentStory;

    Alert ("number of characters to spill is

    "+ myParentStory.characters.itemByRange (myFrame.characters [-1],".

    (myParentStory.characters [-1]) .length-1);

    Ariel

  • How to get the Partitions that have become readers return Partitions?

    In XP SP3, two of my drive C: (9 MB FAT & 3.63 GB FAT32) partitions became readers H and I in my computer and generates low disk space warnings, but seem to be ok in computer management/disk management. How can I get these partitions on drive C and eliminating H and I readers that have emerged?

    Hello

    These drive letter are fixed by dell to store files and data from the system. Made registry changes the drive letter to visible on the computer. In order to make any change that we have to contact Dell technical support for assistance.

    Contact Dell

    http://en.community.Dell.com/support-forums/software-OS/f/3524.aspx

    http://www.Dell.com/support/contents/us/en/19/category/contact-information?c=us&l=en&s=DHS&CS=19

    Hope this information helps.

  • How to remove the objects that appear only in outline view?

    I've hidden objects in a file that only appear in schema view. It wont let me select them and is to make the file larger then it must be. Any ideas to get rid of these unwanted items? Thank you!

    You can check if there is a clipping mask in this layer. Open the layer by clicking on the triangle.

  • need to re DOWNLOAD and lost the disc. How to get the program that has been a gift and paid for.

    Hello everyone I pray pray pray! can someone help out me!  My hard drive crashed on my lap top, fortunately I was still under warranty.  so they sent the new hard drive but now I lost a TON of things.  I made backup b4 thanksgiving.  that includes my downloading disc for Photoshop.  I have the one for MAC OS, but I have a PC.  In any case how can I download this again without the disc.  I have the serial numbers and the redemption code.

    Thanks TMOJO

    Downloads available:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • I paid and downloaded pro adobe acrobat but it turns out that its an upgrade, so I'm stuck. I need help to know how to get the program that I really need.

    Very frustrated, I can't speak to someone for this sort. Any help would be very appropriate.

    We were given the link of our designers and it's just an upgrade and when I came to install it request the previous version serial No.. We have not all previous versions, we cannot go past this stage.

    Is there a contact center that I can talk to?

    Thank you

    Amanda

    Hi Sally,

    I recommend you contact customer service regarding this issue.

    Kind regards

    Rahul Tyagi

Maybe you are looking for