[JS] [ID5] Check if the cell contains fixed graphic

Hello

I have the following script:

var myDoc = app.activeDocument;
var myImages = myDoc.allGraphics;

var myTables = myDoc.stories.everyItem().tables.everyItem().getElements();

for (i=0; i<myImages.length; i++)
{  
for (j=0;j<myTables.length;j++) {

var myActiveTable = myTables[j];

if (myActiveTable.rows.everyItem().cells.everyItem().texts[0].contents == myImages[i]) 

I want to check if a table cell contains a graphic online, but don't know how to do it!

Best regards, Sjoerd

The 'content' of a text element contains the unformatted text, so it's curious, why you thought it works somehow...

Try http://jongware.mit.edu/idcs6js/pc_Text.html#allGraphics ("lists all of the illustrations contained by text.)

In this case, "allGraphics" is also available for the cell (if you do not have to use ' texts [0]'), rank (so it does not use "rows.everyItem") and even to the Table... There is no need to drill down to the individual texts in the cells and to gather together using everyItem - just use

If (myActiveTable.allGraphics.length > 0)

It contains an inline chart.

Loop through all the images and all the tables does not seem necessary, as an image inside a table "is" a link directly to the object, and in the opposite direction, each inline image knows where he is. Here again, it depends on what information you need to be able to recommend what angle you should address the issue.

I recommend not to use my online version of the reference DOM but download the CHM searchable and indexed instead. Choose the one you need for your release to ID of http://www.jongware.com/idjshelp.html. If you use Windows, you can use it immediately; for Mac, you must find a suitable CHM Viewer.

All I had to do was search "allGraphics" in the index to get an immediate list of objects taken supported this property; Then, it is just a matter of point-and-click down the hierarchy of objects to git for as long as you want to get.

Tags: InDesign

Similar Questions

  • find out if the cell contains one of the sentences several

    I need to analyze some data in Excel and I hit a bit of a roadblock, but if I can some sort of help with a formula that does:

    I want to test the A1 cell to see if it contains one of the following:

    "Partially".

    "Not here."

    "Arrived."

    "Completely".

    Cell A1 contains the text in the box below:

    022-03142452 YYZ LHR 5 20,0.01 partially assigned for the booked flight. XCM YUL 3

    If the cell contains "Partially", then I want the result to display "1".

    If the cell contains "Absent", then I want the result to show '2 '.

    etc...

    Enjoy all the assistance,

    TXS,

    FB

    Try this formula:

    IF (IFERROR (SEARCH ("partially", A1), 0) > 0, 1, IF (IFERROR (SEARCH ("Absent", A1), 0) > 0, 2, IF (IFERROR (SEARCH ("arrived", A1), 0) > 0, 3, IF (IFERROR (SEARCH ("completely", A1), 0) > 0, 4,' '))))

  • How to mount an image of an xml file in the cell of CC2015 graphics

    Hello

    I'm having a very difficult time, editing of an image that is imported with XML graph the table cell. Before graphics power cell was fine but now I can't he mounted. The image is imported into the cell, but each image is placed in the same height created the cell (in fact).

    So, I have to mention that the problem is related to the import of xml for classified ads. Therefore, the page layout is not prepared but generated with import. Image in the cell is necessary in this car design solution.

    I don't know I'm missing something... Please, open your eyes.

    Thank you!!!

    Marko

    Hi Marko,

    Maybe you can avoid the graphics cells, if you place the images in table cells.

    HM, we could try pre-fill a cell text with the content must match a white-space character and after that place the image in the first cell insertion point (as in the former with CC 2014 and before workflow).

    Uwe

  • Check if the table contains a value

    Hi all

    I have a table in TestStand that contains numbers. Numbers are generated by a VI and are ranked randomly.

    (1) how can I check to see if the number "6481" is in this table using a step of TestStand?

    (2) is it possible to put this empty table in TestStand, and then complete the table to the size needed when the VI move back the numbers. (i.e. do the table to the size that the VI generates during execution)?

    See you soon,.

    Chase

    I think you will be interested in this Jürgen!

    I managed to do it in 'one step', using a loop.

  • Check if the collection contains an item

    What is the best way to build a collection and check if it contains specific objects? For example,.

    DECLARE
    Dnames_tab. ARRAY TYPE IS VARCHAR2 (30);
    dept_names dnames_tab;
    BEGIN

    dept_names: = dnames_tab ('Shipping', 'Sales', 'Finance', 'Payroll');

    END;
    /

    How can I check if dept_names contains a specific Department? Is the only way to do a loop?

    MEMBER of operator use:

    DECLARE
        TYPE dnames_tab IS TABLE OF VARCHAR2(30);
        dept_names dnames_tab;
    BEGIN
        dept_names := dnames_tab('Shipping','Sales','Finance','Payroll');
        if 'Finance' member of dept_names
          then
            dbms_output.put_line('Found Finance');
          else
            dbms_output.put_line('Did not find Finance');
        end if;
        if 'nickw2' member of dept_names
          then
            dbms_output.put_line('Found nickw2');
          else
            dbms_output.put_line('Did not find nickw2');
        end if;
    END;
    /
    Found Finance
    Did not find nickw2
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Question: Assign an amount to the cell containing an amount only?

    Hello

    I apologize if this has been answered. I am such a newbie devoid of jargon to look for and find the answer that I'm looking.

    I have cells in which I have a size of entry. Each element of this charge has a value. For example: in a column called P1, each item is worth $ 0.44. I have four columns ranging from P1-P4 so have a different value (amount).

    I would like that numbers calculated these prices and fill in the total in the last cell of a line. I would just enter the quantity in each cell, do not have the unit price displayed, but have a Total dollar amount displayed in one the last cell in the row. Example: Qnty Qnty, Qnty Qnty, Total $

    I can assign an amount to a cell displays only an amount and have that totaled an amount in another cell?

    Here's a screenshot!

    In the example you you do not give results of sample for the value column so it is difficult to know exactly what you want.  Just guess, looking something like this?

    = SUMPRODUCT($E$2:$H$2,E3:H3)

    SG

  • Discovered lines with column names where the cell contains a value

    I have a table with columns Additive_ID, A, B, C. Each Additive_ID has a single row.

    I would like to write a query that returns a result set with two columns: Additive_ID and values. It will have up to three lines for each Additive_ID, with the values column that contains the name of the column in the source table if it contains a 1 for this Additive_ID.

    What is the best way to achieve this?

    (In fact, the source table contains about 50 columns.)
    Select additive_id, decode(A,1,'A') value from your_table union all
    Select additive_id, decode(B,1,'B') value from your_table union all
    Select additive_id, decode(C,1,'C') value from your_table
    

    Here's a quick way to get all the SELECT to build the union:

    Select 'Select additive_id, decode('||column_name||',1,'''||column_name||''') value from your_table union all'
    from cols
    where table_name = 'YOUR_TABLE';
    

    Max

  • Highlight cell when the value is different from the value of the cell in the next row.

    I have a requirement for a table (af:table, not a DB table), in cases where a cell value differs from the value in the row slot, the cell must be highlighted to indicate.

    the entire line can not be highlighted, only the cells with differences. For example, if the table contains data:
    90111    $1000    Widget
    90111    $1000    Cart
    The cell containing the value 'Widget' in the first row must be highlighted, other cells get no highlighting.

    The data comes from a DB, through VO table based on an OA.

    Is it possible to do this in the ADF (11g)?

    Thank you-
    -george

    There is no declarative way to do what the rows of the table are marked. This means that there is no way to access a value as a (+ 1) .attributename
    Here's a few codes. Check http://lucbors.blogspot.de/2012/02/adf-11g-fancy-master-detail-or-how-to.html and http://lucbors.blogspot.de/2012/02/adf-11g-even-fancier-multi-master-multi.html that might help you to implement your case.

    Timo

  • position of the cell - help needed, please

    I have problems with this site, that is created with a table.

    It displays perfectly in Safari (on Mac), but it is messed up in Firefox (PC and Mac) and Internet Explorer (PC). The problem is that the cell containing the navigation (to the top left, under the logo) moves from page to page and goes on some pages.

    This cell is supposed to appear right under the logo with just a small margin of the background showing through. Here's what's happening really (on a sample of pages):
    in the news - good, as well as contact and what you can do
    buy pine - too low and too long (too much space under the last link)
    Merchant Navy - far too low and too long
    what is everything - waaaay too low and waaaay too long (the worst of pages)

    Tests, I found that the question seems to be content in the right cell (the cell of great content on the right area), rather than the navigation or logo cell left. But I can't understand exactly what causes problems of size/position or how to fix it.

    I would appreciate any suggestions. Thank you!

    Alignments of cells can be tricky, when you merged cells like this. I think that the best way to solve this problem is to place all the elements (logo and navigation) left in a nested table, within a single merged cell on the left, which only moves based on the content on the right.

    Andy

  • Copy the text in the cell

    Is it possible to copy text information of one POV to another cell using rules

    I am trying to copy data between two scenarios, but the text in the cell is not copying, when I make a copy of the script to the script, to help

    Hs.Exp's #DestPOV = S #SrcPOV.

    It is not possible to copy the text in the cell. Rule cannot read or write the text in the cell. There is a function that determines if the cell contains text in the cell or not, according to me, if not, that is a limitation.

    -Chris

  • Syntax to check whether an item contains a particular value

    Hello
    In my rtf model, I'm changing the background color according to the value of a security of people. I am unable to verify the exact values, but all of the titles are the same, but contain the same value in the full title (e.g. Secretary main vs vs Support Secretary Executive Secretary). So instead of checking where TITLE = 'Secretary', I need to know how to check where the TITLE contains "Secretary". I don't understand the syntax.
    Any help would be appreciated!
    T

    One way is to test instring Secretary.

    InStr('abcabcabc','a',2)
    The instr function returns the location of a substring in a string. The syntax of the instr function is:

    InStr (string1, string2, [start_position], [nth_appearance])

    string1 is the string to search for.

    string2 is the substring to search for in string1.

    start_position is the position in string1 where the search will begin. The first position in the string is 1. If the start_position is negative, the function account back start_position number of characters from the end of string1, then research toward the start of string1.

    nth appearance is the appearance of Nth of string2.

  • How can I make the width of the cell fixed by percentage in a table?

    I have a table in a grid of liquid, which I would like "width" to be fixed cells [I want to the height to increase when I put the text in the cell, but not the width]. Here's the html code:

    < table width = "95%" border = "1" >

    < b >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < scope = "col" th > < /th >

    < /tr >

    < /table >

    Thanks in advance

    You could give an id to the table, and then target the th of the table tags to give them heights VH (% of the height of the viewport) on the css. Something like...

    In the html code...

    In the css...

    {#mytable}

    Width: 95%;

    }

    #mytable th {}

    min-height: 50vh; / * 50% of the height of the viewport but can to be more important if the content wants more * /.

    }

    Height in css works a little differently than you expect. Using a right unit % will make the element this height % of the adjustment of the height of the parent element. If there is no parameter in the parent, the child setting is ignored. In my example, I use the vh unit based on the height of the viewport for the minimum height of the element. In this way, if the content ends up needing more space that otherwise, would be available, it will not "come out" of the container. Instead, the container will expand to contain the content or be 50% of the height of the current window, if it is larger.

    It works very well in the modern browser, but is ignored in what anyone lower than IE9.

    There are probably better ways to do what you want, without the aid of a table.

  • How to check if the mobile/cell the same phone number is registered on the different apple ID?

    Hello

    Is it possible to have the same number of mobile/cell phone with several Apple ID?

    If Yes, is it possible to check if the number is connected to several Apple ID? and how it can be removed?

    When I changed my job, I got a new cell phone number.

    I disconnected all my devices and removed my old number of my Apple ID, after that, I added my new number to my Apple ID and connected to my devices (iPhone, iPad and MacBook Air).

    The thing is that the person who had my new phone number previously, had the same phone number, added to their Apple ID.

    I get time iMessage and FaceTime applications contact the previous owner of my phone number.

    Even if it's annoying that I don't really like, I just block the numbers I don't recognize.

    But my big question is, if my friends iMessage and FaceTime applications for my new phone number can be found at the i-devices previous holders?

    I hope it's understandable - because it feels like a security risk.

    / Calle

    Unregister the old number

    https://selfsolve.Apple.com/deregister-IMessage

  • I have the time to default iPhone 4 iOS 7.1.2 iPhone App not updated since the last 3 days and also checked all the settings for location and also set as new iPhone always present problem... Please try to fix... Thanx

    I have the time to default iPhone 4 iOS 7.1.2 iPhone App not updated since the last 3 days and also checked all the settings for location and also set as new iPhone always present problem... Please try to fix... Thanx

    Turn off your device and turn it on again. If this does not help, sign out of your account and reconnect.

    In addition, you can try to reset your settings.

    • Press and hold the sleep/wake button
    • Press and hold the Home button
    • Press and hold both buttons until the display turns off and on again with the Apple logo on the subject.

    Alternatively, you can go to settings - general - reset - Reset all settings

  • How to create a formula that highlights the cell that contains the same data that I type in another cell

    Hi, can someone help me make a formula which detects and highlights the value of the cell that contains the items of data that I entered in another cell? Thank you

    resolved to myself

Maybe you are looking for