How to get pagenumber of anchored Box

In javascript, how to get page number of anchored textbox.
if i gave "textframes[0].parent" means it shows an error.
Thanks

Usually, the "textframes" array of an object points to the textframes contained in that object. Therefore, if you ask something with textframes what the parent is of "textframes[0]", you will get that same object again.
In this case you are getting an error because there are (apparently) no text frames inside the anchored object.
To try out stuff like this you can use the "constructor.name" construction:
alert (app.selection[0].parent.constructor.name);
with the anchored object selected results "Character". That cannot ever be a part of a page, so you have to get up another level:
alert (app.selection[0].parent.parent.constructor.name);
will tell you it's a Story. Now that's obviously wrong, because a story can run over several pages. Looking into the Object Model, you will see a character also has a property "parentTextFrames" (described as "The text frames that contain the Character. Can return: Array of TextFrames or TextPaths."). Checking with
alert (app.selection[0].parent.parentTextFrames[0].constructor.name);
now returns the text frame of the story where the actual character -- in this case the Anchored object -- is located in.
For simple documents and scripts, you are done here: the parent of a text frame is the page. If this frame in turn could be anchored inside something else, or the anchored object could be inside a table or something like that, or the objects could be on the pasteboard or on a master page, you'll need additional checks.

Similar Messages

  • How to get title in Dialog box

    How to get title in Dialog box like "Adobe® Connect™ "

    Works for me. What happened when you tried?
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #E6E6EE;
    overflow: auto;"
    title="this text can be pasted into the AppleScript Editor">
    tell application "Finder" to display dialog "I need ® or ™ in dialog box text" with title "I need ® or ™ in dialog box text" buttons {"Aha!"} default button 1</pre>

  • How  to get  the  Save  dialouge box  in   SAP Business One

    Hi,
    How  to get the  Save dialouge box in    Button  click  event  in  SAP Business One.
    Thanks,
    Y.

    Hello,
    You would like to display an SaveFileDialog box?
    may follow this thread, and you can find a sourcecode in vb.net and c# inside (for open dialog, but it is the similar...)
    Regards
    János

  • How to get System status Check Boxes into Query selection screen

    Dear experts,
    Pleas help in knowing how to get System status Check Boxes into quick view query (SQVI), selectionscreen.
    Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on Jul 6, 2010 7:26 PM

    Problem solved through other Forum
    (Checkboxes not possible, some alternative solution to my requirement found)

  • How will get  to the transaction box. directley(shourtcut)

    hi
    how will get  to the transaction box. directley(shourtcut)?

    Hello,
    for SAP GUI for Windows, it is Ctrl + / .
    For list of keyboard shortcuts, see menu item "Help for SAP GUI" in the menu shown when clicking the right most toolbar button.
    for SAP GUI for Java, it is Ctrl + T (Cmd + T on Mac).
    For keyboard shortcuts, see the menu items in the menus  with the icons on the right.
    Best regards
    Rolf-Martin

  • How to get rid of black box borders that occur around text

    When ever I type ANYTHING in emails, Pages, I get this irritating black box that shows up around paragraphs.  How do I get rid of this once and FOREVER?

    Press the key combination command-F5 to deactivate VoiceOver. If that doesn't work, proceed as follows.
    For OS X 10.7: From the menu bar, select
     ▹ System Preferences ▹ Universal Access ▹ Seeing ▹ VoiceOver: Off
    For OS X 10.8: Select
     ▹ System Preferences ▹ Accessibility ▹ VoiceOver
    and uncheck the box labeled Enable VoiceOver.

  • How to get rid of navigation box

    Hi guys i would like to know how to get rid of the navigation box in iphoto.  i have mountain lion and the most updated version of iLife. 
    this is the box i am reffering to . 

    Really? You asked a specific question and got a specific answer. Turns out you had a different question...
    You can't.
    Regards
    TD

  • How to get Open/Save Dialogue box

    Hi,
    I need to get open/save dialogue box while downloading a file (from JSP).
    One way which I am currently using is on click of the button pass control to servlet and in servlet using the following code:
    /**.....Some Code */
    response.setContentType("application/csv");
    response.setHeader("Content-Disposition", "attachment; filename=" + filename);
    /**.....Some Code */But I am wondering is there any way I can do the same without passing the control to Servlet? On clicking the button in JSP, is there is any possibilty to get the Open/Save dialogue box directly.
    Thanks
    Arun

    without passing the control to Servlet?Why?
    In HTTP you can send the response only once.The application where i have this requirement is an old one. In the application, I have there are some screens, whose control never goes to Servlet.
    TO be more precise, 2 pages one HTML and another JSP. And the file to be downloaded is created when JSP is called from HTML page. And there is no interaction with Servlet. The JSP inturn calls a method in Java file (which is not a Servlet) and gets all the details including the file to be downloaded.
    I have used window.open() to download the file(in JSP) in order to have Open/Save dialogue box.
    But the approach is working fine in Windows XP systems but not in Windows2000. In Win00 machines it is directly opening the file in popup without giving the user any option for Open/Save.
    Please let me know your suggestion on this.
    Thanks

  • How to get the "delete" check box back?

    Hi Guys,
    I just used the "Migrate to Interactive Report" feature. After doing so, the check box is gone that is used to indicate rows to delete. A copy of the region is marked as "disabled" and the check box is still there, but it's not in the newly created region. Without that check box, my page has no way to delete rows. How do I add the check box to the new Interactive Report region? I'd rather not re-create the page from scratch.
    Thanks,
    Kim
    P.S. I'm using Apex 4.1 and Oracle 11g xe - all running on Windows 7.

    How about something like this? Instead of a check box add a new column with a delete image, you can use something like delete.gif (#IMAGE_PREFIX#delete.gif). The downside is that will be deleting one at a time, but in my experience this may not be an issue.
    Add a hidden item to hold the ID of the row your want to delete. We'll call it P1_ID.
    The new column with the delete image will need to "branch" to a URL and use this code (ALL in one single line)
    apex.confirm("Are you sure you want to delete?", {
      request:"DELETE_ROW",
      set:{"P1_ID":#ID#}
      });Then add a page process that fires when the request is DELETE_ROW
    Would probably look something like this:
    delete from some_table where id = :P1_ID;
    A similar technique can be used for checkboxes, but it's a little more advanced as you need to loop through the selections.
    Oh and add the column to the IR you don't really need to select anything. Or better yet, you could re-use the ID column of the report if you have one as your delete column. The #ID# on the code above needs to be the name of your column. So if your column is EMPNO the above would be #EMPNO# instead of #ID#.
    Hope this helps.
    -Jorge

  • How to get Case Sensitive Check Box at Search Page

    Hi Everyone,
    I am trying to get case sensitive check box at the bottom of the search page, for that we have to set any propert or we ahve to do anything else.
    Please Help!!!!
    Thanks,
    Amit

    Have never really thought of it. One thing you need to do is set the Case Insesitive Searching Option correclty in PeopleTools Options. I can't find any other setings. But it might have to do with the fields that are on your Search record. My guess is if any of the Search Fields are of type Character and format Mixedcase then the Case Sensitive check box will be displayed automatically.

  • How to get pagenumber from a anchored rectangle?

    Hi all!
    I want to know the pagenumber from a rectangle, which is anchored inside a textframe.
    I've got the UID from this rectangle.
    Thanks!

    It works!
    UIDList selectedItems;
    ErrorCode errorCode;
    PMString strPageNumber;
    IDocument* iDocument = Utils<ILayoutUIUtils>()->GetFrontDocument();
    if (iDocument == nil) { CAlert::ErrorAlert("iDocument == nil"); break; }
    // Get the document's database
    IDataBase* iDatabase = ::GetDataBase((IPMUnknown*)iDocument);
    if (iDatabase == nil) { CAlert::ErrorAlert("iDatabase == nil"); break; }
    InterfacePtr<ISelectionManager> iSelectionManager(Utils<ISelectionUtils>()->QueryActiveSelection());
    if (iSelectionManager == nil) { CAlert::ErrorAlert("iSelectionManager == nil"); break; }
    InterfacePtr<IHelloWorldSuite> iHelloWorldSuite(iSelectionManager, UseDefaultIID());
    if (iHelloWorldSuite == nil) { CAlert::ErrorAlert("iHelloWorldSuite"); break; }
    // Here I get the UID of the inline frame over selection
    errorCode = iHelloWorldSuite->GetSelectedFrameUIDList(selectedItems);
    if (errorCode == kFailure) break;
    Utils<ILayoutUtils> iLayoutUtils;
    // Get the hierarchy
    InterfacePtr<IHierarchy> iHierarchy(iDatabase, selectedItems[0], UseDefaultIID());
    if (iHierarchy == nil) { CAlert::ErrorAlert("iHierarchy == nil"); break; }
    // Get the page UID
    UID ownerPageUID = iLayoutUtils->GetOwnerPageUID(iHierarchy);
    // Get page number string
    InterfacePtr<IPageList> iPageList((IPMUnknown*)iDocument, UseDefaultIID());
    if (iPageList == nil){ CAlert::ErrorAlert("iPageList == nil"); break; }
    iPageList->GetPageString(ownerPageUID, &strPageNumber);
    // Show page number string
    CAlert::InformationAlert(strPageNumber);

  • How to get document's Bleed Box

    Hi all,
    I want to get the current bleed settings of a document, but can't find any class in the SDK making this available.
    There is INewDocCmdData which allows to set the bleed box for a new document, so if there is a way to get an INewDocCmdData for an existing document, that would work. But I don't know how to achieve that either.
    Another option seems to be via the script interface. There are Javascript classes and methods defined to get a document's bleed box. But can I somehow run a short script snippet from within C++ and extract the result?
    Any pointers would be really great.
    Bernd

    Look to IPageSetupPrefs on the document boss.
    Ian

  • How to get value from option box and submit accordingly

    Sorry for posting my question. I have been trying to edit message and repost it and not successful. Hence I am reposting my question. Please let me know.
    I am right now exploring JSF for presentation layer. I am designing a form with <h:outputLabel..> and <h:inputText...> for the user to input his value. I also have a radio button as below. <h:outputLabel..>
    <h:inputText...>
    <h:selectOneRadio id="libraryList" >
                                <f:selectItems value="#{libraryList}"/>
                            </h:selectOneRadio>And I have included the following piece of code in faces-config.xml as below.
    <managed-bean>
            <managed-bean-name>libraryList</managed-bean-name>
            <managed-bean-class>java.util.HashMap</managed-bean-class>
            <managed-bean-scope>application</managed-bean-scope>
            <map-entries>
                <map-entry>
                    <key>Pass</key>
                    <value>Pass</value>
                </map-entry>
                <map-entry>
                    <key>Fail</key>
                    <value>Fail</value>
                </map-entry>
            </map-entries>
        </managed-bean>Hence I get two option box as Pass and Fail.
    I am also bit aware of navigation rules of JSF. Now I want the user to take to the step 2 if he chooses the option Pass and if the user chooses Fail, then I want to reset the values of the above form and display the same form.
    I have not done any Java part of the application yet as I am a newbee and hence started doing JSP pages and config-faces.xml part. Please let me know how to proceed further.

    Create a bean, bind the value to the bean, let the action method return that value and add navigation-case entries for those outcomes.

  • How to get rid of OKCODE Box on WebSAPConsole

    The RF devices we are using are SYMBOL MC9090. We are running WebSAPConsole and there are two problems that are killing us right now:
    1- We can't seem to program the ENTER key (to affect navigation) into the RF devices. We want the bar code scan to have a suffix with an ENTER key to navigate to the next field. This doesn't appear to be working.  Anyone have this working that can tell us how they did it?
    2- We want to get rid of the OKCODE box which is now displayed at the bottom of all our screens. I noticed that others have examples of their screens without this box displayed so I assume it can be turned off....
    I realize I may have used the wrong terms and these problems may have already been addressed. Anyone that can point me in the right direction?

    We need to get rid of the OKCODE Box on the bottom of the screens. My programs are standard SAP screens and I have tried modal dialog screens with the STARTING AT and ENDING AT commands. All behave the same way.
    I have no OKCODE on these screens and none is present when we run in the standard GUI. However, the OKCODE is present when we run on the handhelds.
    The handhelds are MC9090 (Symbol) running Windows Mobile, we are running WebSAPConsole and we just want to get rid of the OKCODE Box on the bottom of the screens.
    The SAP standard RF transactions behave the same way as the custom transactions. Can we just get rid of the OKCODE box on the bottom of the screens?
    Thansk again for the help.... this is killing us right now....
    Steve

  • How to get bounds of bounding box of text item.

    Hi all,
    I am trying to get the bounds of bounding box of paragraph text item. I found the following link,
    the coordinate of a bounding box is the same as the layer's coordinate?
    But the solution doesn't work for me. It gives me the layer's bound every time i.e. the bounds of actual text.
    Can someone have any idea how to accomplish this?
    Thanks.

    It's a known "not trivial". You have layer.textItem.width/height, but they don't always report correct values. I.e. if the layer or doc has been resized, those values are missing scale multipliers. Worse it's works differently wrong in different versions of CC and Mac/Win. What I use is below (with some utility functions missing), but it's just CC 2012 and 2014 (CS6 is just bounds).
    Alternatively you can get this stuff on Action Manager only, but I'm not familiar enough and let other comment on it.
    Photoshop = {
      getTextExtents: function (layer) {
      if (layer && layer.textItem) {
      var text_item = layer.textItem
      if (Photoshop.isCC2014() || (Photoshop.isMac() && Photoshop.isCC2012())) { // in mac the newer method is correct also in CC2012
      return Photoshop._getTextExtentsCC2014(text_item)
      } else if (Photoshop.isCC2012()) {
      return Photoshop._getTextExtentsCC2012(text_item)
      } else {
      return Photoshop._getTextExtentsCS6(text_item)
      _getTextExtentsCC2014: function (text_item) {
      app.activeDocument.activeLayer = text_item.parent
      var ref = new ActionReference()
      ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )
      var action = executeActionGet(ref)
      //Photoshop._debugActionKeys(action)
      var textKey = action.getObjectValue(stringIDToTypeID('textKey'))
      var bounds = textKey.getObjectValue(stringIDToTypeID('bounds'))
      var width = bounds.getUnitDoubleValue (stringIDToTypeID('right'))
      var height = bounds.getUnitDoubleValue (stringIDToTypeID('bottom'))
      var x_scale = 1
      var y_scale = 1
      if (textKey.hasKey(stringIDToTypeID('transform'))) { 
      var transform = textKey.getObjectValue(stringIDToTypeID('transform'))
      x_scale = transform.getUnitDoubleValue (stringIDToTypeID('xx'))
      y_scale = transform.getUnitDoubleValue (stringIDToTypeID('yy'))
      x_scale *= width / text_item.width
      y_scale *= height / text_item.height
      return {
      x:Math.round(text_item.position[0]),
      y:Math.round(text_item.position[1]),
      width:Math.round(width*x_scale),
      height:Math.round(height*y_scale) }
      _getTextExtentsCC2012: function(text_item) {
      app.activeDocument.activeLayer = text_item.parent
      var ref = new ActionReference()
      ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )
      var action = executeActionGet(ref)
      var textKey = action.getObjectValue(stringIDToTypeID('textKey'))
      //Photoshop._debugActionKeys(textKey)
      var bounds = textKey.getObjectValue(stringIDToTypeID('bounds')) 
      var width = bounds.getUnitDoubleValue (stringIDToTypeID('right')) 
      var height = bounds.getUnitDoubleValue (stringIDToTypeID('bottom')) 
      var x_scale = 1
      var y_scale = 1
      if (textKey.hasKey(stringIDToTypeID('transform'))) { 
      var transform = textKey.getObjectValue(stringIDToTypeID('transform'))
      x_scale = transform.getUnitDoubleValue (stringIDToTypeID('xx'))
      y_scale = transform.getUnitDoubleValue (stringIDToTypeID('yy'))
      return {
      x:Math.round(text_item.position[0]),
      y:Math.round(text_item.position[1]),
      width:Math.round(width*x_scale),
      height:Math.round(height*y_scale)
      _getTextExtentsCS6: function (text_item) {
      var layer = text_item.parent
      return {
      x:Photoshop.getLayerLeft(layer),
      y:Photoshop.getLayerBottom(layer),
      width:Photoshop.getLayerWidth(layer),
      height:Photoshop.getLayerHeight(layer)

Maybe you are looking for

  • Do I have to create a new account for my iPhone, or can I use my iPod Touch account?

    I have an iPod Touch 32GB which I have an iTunes account for, & I need to know whether I have to create a new iTunes account for my new iPhone 4 16GB, or whether I can use the other one for. Would syncing cause problems?

  • Problem in deleting the message after reading

    Hi I m having some problem to delete the message after reading. i read the FAQ, and there is only one question regarding to delete that i have tried but its not working As my application required that message should be deleted after the processing. P

  • Update query using FORALL statement

    Hi ALL, I have two tables Table: Mater_A(20 Cloumns) and Temp_A(20 Columns). Both are almost identical. The Master_A is master table that has to be updated daily based on the temporary table Temp_A. Everyday , i expect around 100000 records(same reco

  • Error code 2908

    while i was trying to upgrade my itunes to the 7.3 version it will not install and gives me error code 2908 unable to install can anybody help me

  • Tuxedo Service Debugging

    Hi All , Is it possible to debug Tuxedo Services using GDB in Unix environment (AIX) .. Could you please share your experience in this regard Thanks in advance Nadeer.