Find an object with an object style and increase its height! …

Hi all

I found each (anchored to the current text) 'invisible' block with a specific 'AA' object style and change its height SO its offset is > 180 (depending on the origin 0,0 page by default).

This seems to be simple but, still, who doesn't!

Thanks in advance!

(^/)

app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "xxx");
  
function main()
{  
  
app.findObjectPreferences = null; 
app.findObjectPreferences.appliedObjectStyles = "AA"; 
myFound = app.activeDocument.findObject();


for (i = 0; i < myFound.length; i++)  
     {  
        var myGB = myFound.geometricBounds;
        var myYOffset = myGB[2]; 
        var myHeight = myGB[2] - myGB[0]; 
        
        if (myYOffset[i] > 180) myHeight[i] += 90; 
     }  

}

Replace this:

myFound.geometricBounds

with this:

.geometricBounds myFound [i]

You must then change the geometricBounds and apply it to the object:

myGB =...

myFound [i] .geometricBounds = myGB

Something in this direction.

Peter

Tags: InDesign

Similar Questions

  • best judgment for paragraph styles, object styles and character styles

    I want to learn the criteria difference and use of paragraph styles, object styles and character styles. I know how to use them, but know about the best judgment and context, when you use would be better. Can anyone recommend links? I've been using adobe. Please don't suggest books.

    Paragraph styles are whole paragraphs.

    Character styles are letters or isolated words. Do not use the long of an entire paragraph. Do not set all the attributes, only those who are different for the properties of the paragraph Style. Unlike Quark Xpress, in InDesign are character Styles used only for the difference of isolated words.

    Paragraph styles can include the character automatically Style: Styles, GREP, nested Styles, initial letters, chips automatic & numbers and line styles.

    Object styles , set the frame of the object. They include separate definitions of all of the object, the stroke and fill.

    Object styles can also be applied to images in a frame and groups.

    Object styles may also include in the following paragraph Style and a style of paragraphs in automatic way.

    Object styles have several categories, you can choose which category is relevant to apply. For example, it is possible to apply the first style object to give the stroke and fill and apply a different object style to format the corners only and then apply the next. (With this method last only the applied object Style is linked).

    Styles of the opportunity to make global changes in a document. If you build in a smart way, they are a huge time saver. They can be stored in the CC libraries or libraries with objects that are applied to them. If you have created once these styles, you can use them again, and with one or two clicks, you can make their own to new document.

    My recommendation: the habit of Styles, name them always with the same names that it helps you to be accustomed to them and to work faster, much faster.

    There are more models: Table Styles, Styles of cell, the Master Pages and color chart.

  • Find the element of object styles, and then copy it

    Hello, I would like to create a script.

    Find elements of object styles:

    Outside of the document, I create on block with the style of the object "reference". It will be unique.

    Once selected, I want to put it on the Clipboard or simply make a copy.

    If selected by object styles is not possible, how can I do an id on my element?

    Can you help me?

    Thancks a lot!

    YES!

    I solved the problem like this:

    var obj1 = app.selection [1];

    var obj2 = app.selection [0];

    Alert (obj1 and obj2);

    obj1. Select();

    App.Copy ();

    app.loadFindChangeQuery ("PuceSimple_enPuceCouleur_Courant", SearchModes.grepSearch);

    obj2.changeGrep ();

    But I have a question.

    How the script knows which is the number 0 and the number 1?

    This is the order of selection? in position on the page?

    Could be done as follows:

    var obj1 is app. Docuement.Item ("reference");

    var obj2 = app.selection [0];

  • Unable to save object Style and can't open the Style of ERROR object manager

    HY

    I'm confused. When you try to save a Style I can click OK and nothing happens.

    When you try to open the Captivate 8 style Manager is colapsing with a fatal error. (Captivate 8.01.242)

    When I open examples of projects I don't have this problem. It is when creating new projects.

    What can I do?

    Greetings

    Joachim

    What do you see in the themes? In German, I see that the button has the label "design"? I try just, totally baffled by your problem.

    The Layouts folder that I was talking about seems to be corrupted. That's why I asked if you removed before reinstalling. The path is:

  • Impossible to format document with several paragraph styles and notes

    I'm working on a document where I have several text boxes on the same page. The text boxes reflect implemented different paragraph styles so that they will autopopulate in my table of contents. However, I need to add notes to this document. I find that the notes are at the end of the text box to which they apply to, and if I had to put a note in two different text boxes on the same page, both start at 1.

    Is it possible to manage notes in several text boxes? Or, if not, is it possible that I can attach my table of contents for the styles of characters instead of paragraph styles?

    Thank you!

    Looking at your screen shot in post #2, I see no reason to require individual images. You can manage every bit of this formatting in a unique setting using the styles section to control alignment, and dashes.

  • How to find a file with the author of 'unknown '. Its an antivirs software and I cannot locate the uninstall/remove. I already have 'Norton' and I don't want to "Avira" HOW THEN I DISCOVERED "WINDOWS the PROGRAMS of START-UP BLOCKED."

    Can I locate? It is in the "(chose fenêtres bloquées les programmes de démarrage) that lights up when I start my computer." but I disabled it and I know what to do, but how can I veiw the program 'windows blocked startup programs' if it does not start?

    answered in another thread

    http://social.answers.Microsoft.com/forums/en-us/vistafiles/thread/e425669e-93f8-457d-852b-4416bba88f3d
    Rob - bicycle - Mark Twain said it is good.

  • Could not find the device with uuid - ESXi 4 and 5 - Dell 2950

    Hello

    I am installing ESXi4 or 5 on a Dell 2950.  I'm not an expert material guy, but I think the controller is a Perc 5 controller hardware / i.  It is a processor of Intel Xeon dual core CPU 2.

    The link of compatibility:

    http://www.VMware.com/resources/compatibility/search.php

    I see only the processors Xeon 5xxx and above seem to be supported, and I honestly don't know if mine it fits or not but when I had installed CentOS and made ' less/proc/cpuinfo', no model number came, just that it was a Xeon processor.

    When I install ESXi on this server (I turned on hardware virtualization in the BIOS), the installation looks ok, but when the computer restarts, it always seems to try to load my old server CentOS so it's as if the installation has not completely replace the drive. Raid Controller had 2 virtual disks so maybe I didn't replace what was a disc of "boot"?  I will try that next.

    Guess I'm looking for confirmation that the CPU is ok and I'm missing nothing else.

    Thank you

    Charles

    1 in the raid bios remove the raid and create a new one, and then reinstall esxi.

    2 when you install also use iso Dell:

    do both and you should have a running system.

    http://www.Dell.com/support/drivers/us/en/04/DriverDetails/product/PowerEdge-R620?driverId=XWYR5&osCode=XI51&FILEID=3005015335

    This is the link above

    I try to keep updated here: http://sparrowangelstechnology.blogspot.com/search?q=dell+iso

  • Can I create a form using the object styles in InDesign

    Hello

    Is it possible to create a form in the object Styles I can create in InDesign? I know that I can attribute some qualities, but I would like to create a capsule form that will be repeated throughout a page of lists in our sites.

    So far, I have to copy, paste, and anchor the object in the text which is quite time that we have thousands of ads, and life is too short for mundane tasks.

    If I can create a form of object Styles, by entering its dimensions, it will allow me to create the style for import into InDesign, 4 d, our CMS.

    If not, can we have it in a new construction, please Adobe?

    I look forward to your reply.

    Thank you

    Roy

    That can be done with tabs and styles nested using underscore with a custom stroke style. I hope that these screenshots should explain it...

  • Script for Indesign find paragraph style change at the table with the table style

    Hello

    I hope someone could help me with a script.

    I can tab with a paragraph style and I want to convert that to a table with a table style.

    Kind regards

    Patrick

    Yes

    My problem is solved

    Thank you very much.

    Patrick

  • Registration of Styles and preferences

    Captivate v5.5

    Recently, I had a problem with my PC which has resulted in my duty of re - install Captivate from work. It is while I found all my Styles and preferences have been lost and have no trace of what settings I used the was a long job, trying to catch what I have has been used on previous projects.

    Now I said that I have more work on my PC - installation of Windows 7, which means once again I have to re - install Captivate.

    Is there anyway to record/save my current object Styles and preferences before putting the hand on my PC?

    Noel

    Try: File, Export, preferences (creates a file with extension cpr) and re - import reinstall them after (file, import, preferences); for Styles: file, export, Styles (will create a file with extension cps) and dito for re-import

    Lilybiri

  • Can I find and replace an object? And I can copy styles from another file InDesign?

    Hi all

    I hope someone has a solution to these two...:

    First, I have a line object between two text frame, and I want to change the thickness and color, no problem, it's

    the problem is I have 100 of them and now I'm a one, is it all find and replace for an object?

    Secondly, is it possible to copy a style from another file InDesign without synchronization of all styles in a book file?

    I'll be very grateful for an answer!

    Thank you

    Vraja

    In the find and Replace dialog box, there is a tab object. You can find your line by its attributes and change. I suggest the setting up and style object and replace all your lines of this style. In this way, the next time you need to change them, you can change the style.

    Regarding the copy of a style of an InDesign document to another. You can just copy something to the style and paste it into the document you want to move to.  (This will not work if the style of the same name exists in the file you are pasting to. In this case, your stuck item would take on the attributes already defined in the new file).

  • Find anchored objects (reference point and exposed position) script

    Hi all

    is there anyway to find anchored (reference point and exposed position) of inDesign objects and overthrow their attributes or change them in all the documents, I opened, but by the script because sometimes when I try to do that find and replace option files crash or replacement process does not receive all wanted items

    ex:

    I want to find objects anchored with below attributes

    1.png

    and change them to:

    2.png

    Thanks to all in advance

    Hello

    Try this code to find and change,

    myDocument var = app.activeDocument;

    app.findObjectPreferences = NothingEnum.nothing;

    app.changeObjectPreferences = NothingEnum.nothing;

    app.findObjectPreferences.anchoredPosition = AnchorPosition.ANCHORED;

    app.findObjectPreferences.anchorPoint = AnchorPoint.CENTER_ANCHOR;

    app.findObjectPreferences.positionReferencePoint = AnchorPoint.RIGHT_CENTER_ANCHOR;

    app.changeObjectPreferences.anchoredPosition = AnchorPosition.ANCHORED;

    app.changeObjectPreferences.anchorPoint = AnchorPoint.CENTER_ANCHOR;

    app.changeObjectPreferences.positionReferencePoint = AnchorPoint.LEFT_CENTER_ANCHOR;

    myDocument.changeObject ();

    app.findObjectPreferences = NothingEnum.nothing;

    app.changeObjectPreferences = NothingEnum.nothing;

  • Creating an object with a script style

    I slowly teach me scripting, but my first script has a bug that I can't fix. Part of it creates an object called a "plain text" style that has certain qualities. One of these attributes is that the first offset base should be "attached" to a certain leader. When I run the script in InDesign CS3, sometimes it works and the first base offset is "fixed", but sometimes this does not work and the first base line offset remains at the default of "rise." I need to work in InDesign CS4, too, but it does not there at all. I looked into the DOM, but it seems that everything is coded correctly.

    Here is a part of the script. What Miss me?

    Create the object style "plain text".
    var myPlainTextObjectStyle = myDocument.objectStyles.add ();
    {with (myPlainTextObjectStyle)}
    name = "plain text";
    enableFill = true;
    enableStroke = true;
    enableStrokeAndCornerOptions = false;
    enableTextFrameBaselineOptions = true;
    enableTextFrameGeneralOptions = true;
    fillColor = myDocument.swatches.item (0);
    strokeColor = myDocument.swatches.item (0);
    textFramePreferences.firstBaselineOffset.firstBaseline = FirstBaseline.FIXED_HEIGHT;
    textFramePreferences.minimumFirstBaselineOffset = myLeading;
    textFramePreferences.textColumnCount = 1;
    textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN;
    }

    Your problem is that you have an extra "firstBasline" in the line that defines the firstBaselineOffset. Your script is:

    //Creating the "plain text" object style.
    var myPlainTextObjectStyle = myDocument.objectStyles.add();
    with(myPlainTextObjectStyle){
    name = "plain text";
    enableFill = true;
    enableStroke = true;
    enableStrokeAndCornerOptions = false;
    enableTextFrameBaselineOptions = true;
    enableTextFrameGeneralOptions = true;
    fillColor = myDocument.swatches.item(0);
    strokeColor = myDocument.swatches.item(0);
    textFramePreferences.firstBaselineOffset = FirstBaseline.FIXED_HEIGHT;
    textFramePreferences.minimumFirstBaselineOffset = myLeading;
    textFramePreferences.textColumnCount = 1;
    textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN;
    }
    

    Even if there's a better syntax you can use:

    //Creating the "plain text" object style.
    var myPlainTextObjectStyle = myDocument.objectStyles.add();
    myPlainTextObjectStyle.properties = {
         name : "plain text",
         enableFill : true,
         enableStroke : true,
         enableStrokeAndCornerOptions : false,
         enableTextFrameBaselineOptions : true,
         enableTextFrameGeneralOptions : true,
         fillColor : myDocument.swatches.item(0),
         strokeColor : myDocument.swatches.item(0),
         textFramePreferences : {
              firstBaselineOffset : FirstBaseline.FIXED_HEIGHT,
              minimumFirstBaselineOffset : myLeading,
              textColumnCount : 1,
              verticalJustification : VerticalJustification.TOP_ALIGN
         }
    }
    

    What makes this better, it is just an interaction with the object model, rather than one for each property in the object style.

    Dave

  • [CS3/4, JS] Apply the pen with an object style

    I was hoping to apply transparency via an object style effects using this:

    myObjectStyle.objectStyleContentEffectsCategorySettings.enableFeather = true;

    But "object does not support the property or method...". "etc.

    I would be very grateful if someone could point me in the right direction.

    Thanks in advance - Jeremy

    I had this same problem with the bevel and emboss effect and I just thought about it!

    Here is the code for my style of object and bevel/stamping out perfectly.  The key is the last line.  You must set the parameter applied to true so he could check the box and actually apply the effect.

    var myObjectStyle = myDocument.objectStyles.item ("FamilyOfFrame");
    try {}
    var myObjectStyle.name = MyName;
    }
    {} catch (MonErreur)
    myObjectStyle = myDocument.objectStyles.add({name:"FamilyOfFrame"});)
    }
    myObjectStyle.strokeWeight = 0;
    myObjectStyle.transparencySettings.bevelAndEmbossSettings.size =. 09;
    myObjectStyle.transparencySettings.bevelAndEmbossSettings.style = 2020618852;
    myObjectStyle.transparencySettings.bevelAndEmbossSettings.applied = true;

    But as I learn... not all effects include the "applied"... property

    Alex

  • With the help of several classes and create an object of a class and calling its method in a different class.

    Creating a new class, I need to move my main method class SaveDate DynamicTest class. Below I've listed the code of both classes. The goal is to be able to run my class DynamicTest program. I need help to understand the process of moving my main method of a different class and creating an object of a class and calling its method.

    public class {SaveData

    private public static final map < String, Object > myCachedTreeMap = new TreeMap < String, Object > ();

    public static final List < String > getLines (final String resourceParam, final Charset charset) throws IOException {}

    System.out.println ("please:" + resourceParam);

    If {(myCachedTreeMap.containsKey (resourceParam))

    Use the file cached, to avoid a further reading.

    System.out.println ("found in memory:" + resourceParam);

    }

    else {}

    Load the file from the disk

    System.out.println ("found in memory:" + resourceParam);

    }

    Returns a null value.

    }

    Public Shared Sub main (String [] args) throws IOException {}

    String target_dir = "C:\\myfiles\\config\\en";

    Line = "C:\\myfiles\\config\\en\\output.txt";

    File dir = new File (target_dir);

    File files [] = dir.listFiles ();

    If (file == null: files.length < 1) {}

    System.out.println ("file list is empty...");

    return;

    }

    Open the Printwriter

    PrintWriter OutputStream = new PrintWriter (output);

    try {}

    for (textFile file: files) {}

    If (textFile.isFile () & & textFile.getName () .endsWith (".txt")) {}

    readFromDisk (textFile);

    }

    }

    }

    {Finally

    outputStream.close ();

    }

    String fileNameFromCache = "en_synonyms.txt";

    Sheet1 = myCachedTreeMap.get (fileNameFromCache) object;

    System.out.println (fileNameFromCache + ": \n" + "Sheet1");

    }

    @SuppressWarnings ("resource")

    private static Sub readFromDisk(File textFile) throws FileNotFoundException, IOException {}

    BufferedReader InputStream;

    inputStream = null;

    String content = "";

    try {}

    inputStream = new BufferedReader (new FileReader (textFile));

    content = readFile (textFile);

    System.out.println ("bytes read =" + content.length ());

    Save the content

    FileContentsObject Sheet1 = new FileContentsObject (System.currentTimeMillis (),

    textFile.lastModified (), content,

    textFile.getName (),

    getLines (null, null));

    Add to the map

    myCachedTreeMap.put (textFile.getName (), Sheet1);

    }

    {Finally

    If (inputStream! = null) {}

    inputStream.close ();

    }

    }

    }

    private static String readFile(File f) throws FileNotFoundException, IOException, UnsupportedEncodingException {}

    Text of StringBuilder = new StringBuilder (1024);

    read int, N = 1024 * 1024;

    char [] buffer = new char [N];

    BufferedReader br = null;

    try {}

    BR = new BufferedReader)

    (new) InputStreamReader

    (new FileInputStream (f), 'UTF8'));

    While (true) {}

    read = br.read (buffer, 0, N);

    If (read > 0)

    Text.Append (new String (buffer, 0, read));

    if(Read < N) {}

    break;

    }

    }

    }

    {Finally

    If (br! = null)

    Br. Close();

    }

    Return text.toString ();

    }

    private static final class FileContentsObject {}

    private long cachedTime; currentTime

    private long lastModifiedTimestamp;

    private string content

    List < String > lines;

    private String fileName;

    public FileContentsObject (long cachedTime, long lastModifiedTimestamp,

    Content string, String fileName, List < String > lines) {}

    this.cachedTime = cachedTime;

    this.lastModifiedTimestamp = lastModifiedTimestamp;

    This.contents = content;

    this.fileName = filename;

    This.Lines = lines;

    SimpleDateFormat sdf = new SimpleDateFormat ("MM/dd/yy hh: mm :"); ")

    System.out.println ("time & Date:" + sdf.format (cachedTime));

    System.out.println ("' last modification timestamp:" ")

    + sdf.format (lastModifiedTimestamp));

    }

    /**

    *

    * @return the lines of the file

    */

    List < String > getLines() {}

    Return this.lines;

    }

    public String toString() {}

    "return"Sheet1 {}"+" fileName =' ' + filename + '------"+", content = "" "

    + content + "\"+ ", lastModifiedTimestamp ="

    + lastModifiedTimestamp + ', CurrentTime & Date ='

    {+ cachedTime + '}';

    }

    }

    }

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    public class DynamicTest {}

    Public Shared Sub main (String [] args) {}

    Game characters charset = Charset.forName("UTF-8");

    try {}

    List < String > = CacheData.getLines lines ("en_synonyms", character set);

    If (rows! = null) {}

    System.out.println ("number of rows:" + lines.size ());

    for {(String ligne: lines)}

    System.out.println ("DynamicTest:" + line);

    }

    }

    } catch (IOException e) {}

    e.printStackTrace ();

    }

    try {}

    List < String > = CacheData.getLines lines ("en_stopwords", character set);

    If (rows! = null) {}

    System.out.println ("number of rows:" + lines.size ());

    for {(String ligne: lines)}

    System.out.println ("DynamicTest:" + line);

    }

    }

    } catch (IOException e) {}

    e.printStackTrace ();

    }

    }

    }

    I have read and watched videos about the creation of an object of a class and calling its method in a different class. I'm still confused on how to do it properly. By using the code below if someone can explain how to properly call the method of objects from my hand.

    Huh? You have NOT posted any 'hand' or any 'method of objects '.

    If you need help with the code, you need to view the code.

    The Java tutorials has dozens of trails "Classes and objects": what they are, how to create and how to use them.

    https://docs.Oracle.com/javase/tutorial/Java/javaOO/classes.html

    1. create an instance of a class

    2. call to one or more of the public methods of this class

    If the class has public static methods, you don't need to create an instance first.

    I suggest that you work your way through these tutorials. They include the WORKING example code.

Maybe you are looking for