How to select a block of text to the Script name?

Hello

I have listed the text block in the code below,

UIDRef uidreference = stories->GetNthTextModelUID(0);

InterfacePtr<ITextModel> TheTextModel (uidreference, UseDefaultIID());

if (TheTextModel is NOTHING)

Break;

IFrameList * Frames = TheTextModel->QueryFrameList();

if (Frameworks is NOTHING)

Break;

AFrameUID UID = images->GetNthFrameUID(0);

I need to select the block of text by Script name (Windows-> Utitities-> Script title).

Please suggest the solution above the problem.

Try,

InterfacePtr script (content, UseDefaultIID());

If {(script)

ScriptLabelValue = script PMString-> GetTag();

CAlert::WarningAlert (scriptLabelValue);

}

Tags: InDesign

Similar Questions

  • How to select several images of text block?

    Hello world

    I'm sure it must be something obvious, but I can't get out!

    I'm trying to select multiple blocks of text. I choose a text frame and then 'shift' to select a second frame and his works fine AS LONG AS the blocks of text are not threaded. When text frames are threaded I can't select more than one at a time?

    Any help would be appreciated! Thank you.  HJ

    You can select several images (threaded or pierced) as long as they are on the same page or spread. But ID won't let you select images that are on different pasta spread.

    Ken

  • How can I create a series of blocks of text using the Excel list values?

    It is first of all, the first script I am trying to write from scratch. I'm completely green at the script and I picked up a few bits of ID Adobe scripting guide, but nothing has really stuck still relating to this particular goal.

    My supervisor maintains a master list of advertising space, with the name of the account, is the width of the space, and how space is the height, in an Excel sheet. These spaces can number in the hundreds, and I'm stuck manually drawing a rectangle for each space, which takes a lot of time.

    I would like to create / helped to create a script that will take these values and "magically" to draw these spaces in the form of blocks of text, with the width (in columns) and the height (in inches) defined by the values in the main list, as well as the name of each account in the subsequent text frames.

    The script didn't necessarily need to be able to pull the values directly from the Excel sheet; Can I transfer a file text if necessary, or directly in the script, values he change because I need it. A great thing (if she is not able to pull directly from an Excel sheet) which is the number of spaces a week changes, and so do the accounts and the width and height. Accordingly, it would be ideal that values of the sheet could be modified easily, in order to create a new set of spaces as necessary.

    Positioning for each space is not crucial, only the height and width. If they were all on top of each other on the same page, it is a result for me. The main idea is to not have to draw them all manually, one by one.

    For me, this looks like a command, but I hope that some experienced there Scripting Guys can help me, because I want to become experienced as well.

    Thus, the TL; DR version:

    -Script to draw a series of text blocks.

    -Size of the text boxes should be defined by the values width and height of spreadsheet Excel.

    -Text blocks must have the account name as content (from account in the Excel worksheet names).

    -Accounts, width and height changes every week in the Excel sheet, so must be relatively easy to exchange all values.

    -Width values on the Excel worksheet columns. It would be ideal that the script could turn those numbers into multiples of columns as necessary.

    -Script (optionally) can take values directly from Excel sheet.

    -Script (option) can set the fill color for the gray text frame. (If it works as I think, I could just select all the resulting images of the text myself and put them all to grey at the same time... I'm not lazy as )

    Thanks in advance to anyone who can help in any way possible, even if it's just a little push in the right direction. This script will save 1 to 2 hours of boredom every week.

    Look like the perfect thing for the InDesign scripting.

    I copy content from Excel to a text file, for a format easily read in InDesign, and there will automatically be a TAB for each 'cell', just using copy and paste.

    Here is a piece of code, perhaps you could go on with (the addition of variable to change pages and the location on the page and other things).

    The readFileLineByLine function, can be easily reused with any function using "recall". You simply tell the function what you want to be executed for each line of text that reads:

    const COLUMN_WIDTH = 2; // Define the column width in inch
    
    var pageIndex;
    var textFramesExported; // not implemented.
    
    // Add a new dokument. Set myDoc to app.activeDocument to use
    // the current document instead of creating a new one.
    var myDoc = app.documents.add();
    
    // The doSomethingWithTextRow function is called upon for every line of text read.
    readFileLineByLine('c:\\test.txt', doSomethingWithTextRow);
    
    function doSomethingWithTextRow(row){
        // We expect the text line to be TAB separated (\t = TAB). We get that from just copying the contents of an
        // excel file into a text document.
        var cells = row.split('\t');
        var companyName = cells[0]; // The Company name in the first slot of the array
        var width = COLUMN_WIDTH * cells[1];
        var height = cells[2];
    
        // Create a new text frame for every row handled
        if (pageIndex==undefined) pageIndex = 0; // Count up when you have exported a number of texts, I leave this for you to do.
        var newTextFrame = myDoc.pages[pageIndex].textFrames.add();
        newTextFrame.contents = companyName;
    
        // The text frame is created in the top left corner.
        newTextFrame.geometricBounds = [0, 0, height + ' in', width + ' in']; // Top, Left, Bottom, Right 
    
        // You might want to move the textframes to other positions, keeping track of how many you put out per page.
        newTextFrame.move( [10, 10] );
    }
    
    function readFileLineByLine(path, callbackFn){
        var myFileIn = new File(path);
        if (File.fs == 'Windows'){
            // This was probably added to recognize UTF-8 (even without its start marker?)
            myFileIn.encoding = 'UTF-8';
        }
        myFileIn.open('r');
        var myEncoding = myFileIn.encoding;
        try{
            if (!myFileIn.exists){
                throw('Missing file: ' + myFileIn.fsName)
            }
            var ln = '';
            while(!myFileIn.eof){
                // Read the lines from the file, until an empty line is found [now as a remark].
                ln = myFileIn.readln()
                // if(ln !='' && ln!='\n'){
                   // Call the function supplied as argument
                   callbackFn(ln);
                // }
            }
        }catch(e){
            alert(e);
            gCancel = true;
        }
        finally{
            myFileIn.close();
        }
    }
    

    The file in C:\ in my example was recorded in UTF-8 format and looks like this (showing hidden characters):

    Post edited by: Andreas Jansson

  • How to select multiple lines of text (without selecting all the text) within a title? (Holding Cmd does not work)

    I need to select several lines of text (in the various sections of the text) within a title without selecting any text. Holding Cmd like you would in other applications does not work, and now Shift selects all. Does anyone have a solution?

    Thank you.

    YYou cannot select several segments of text in a text block.

  • How to select multiple lines of text?

    I need to "BOLD" certain positions and instead of choosing one, then formatting, and then by selecting another, formatting, etc... is there a way to select/highlight several lines of text and apply formatting to each of them at the same time? The sections are separated by other lines of text, they are not continuous.

    Thank you for your help. I use Dreamweaver CS5.5.

    trailslady wrote:

    I can not properly explained. How can I physically select several strings of text with the cursor? Some applications allow you to hold the CTRL key, for example. DW offers a similar feature?

    You have to wait for one of the next versions of Dreamweaver when media becomes an integral part of the tools of coding or do as Nancy and I do, use brackets to the sides of Dreamweaver.

  • Select a block of text with lable

    I'm coming down with a block of text from the document page 2 with label "main script text" but script below does not work.

    app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

    app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

    app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin;

    Try

    {

    var jt = app.activeDocument.pages [2] .textFrames;

    for (i = 0; i < jt.length; i ++)

    If (.label jt [i] is 'Hand Text')

    JT [i]. TextFramePreference.autoSizingType = AutoSizingTypeEnum.HEIGHT_ONLY;

    }

    {catch (e)}

    Alert ("nothing happened");

    }

    Can you please help me what is the error here.

    Counting with numbers index starts with the number 0.

    So the second page is app.documents [0] .pages [1].

    Uwe

  • How to replace a block of text by an .ai file?

    Hello

    I am writing a javascript script Illustrator open a file's get a block of text in the layers/pageItems by its content, then replacing it by a placedItem to the incorporation of another file .ai (shape slightly).

    I managed to get the pageItem and to create the placedItem in this way:

    ...
    var item = mainGroupElement.pageItems[i];
    if(item.contents == 'X') {
      $.write("X found\n");
    
      var walkingManFile = File("D:\\walking-man.ai");
      var walkingManItem = mainGroupElement.placedItems.add();
      walkingManItem.file = walkingManFile;
      walkingManItem.embed();
      var scaleX = item.width / walkingManItem.width * 100;
      var scaleY = item.height / walkingManItem.height * 100;
      walkingManItem.resize(scaleX, scaleY, true, false, false, false, 100, Transformation.CENTER);
      var deltaX = item.position[0] - walkingManItem.position[0];
      var deltaY = item.position[1] - walkingManItem.position[1];
      walkingManItem.translate(deltaX, deltaY, true, false, false, false);
      walkingManItem.trace();
    
      item.remove();
    }
    
    

    'element' typename is TextFrame.

    'WalkingMan' form is well drawn, but not translated and resized at all. However, scaleX, scaleY, deltaX deltaY values seem to be good.

    Anyone know what I'm doing wrong here?

    I'd appreciate any help on this!

    once incorporated, walkingManItem no longer exists (like placedItem), then the reference is lost. Get a reference to the new article created by the embed() method and proceed to your script.

  • Blocks of text on the Pages of body 'Buried' after update of the Page Master

    I have a background full screen on my main page (on the left in this case) that integrates static graphics and borders for certain master pages. I use the borders/boxes for NOTE and END of text on some pages. Blocks of text on these master pages do not overlap. I added text blocks with my icons and the text of the note to these body Pages that I need them. All great so far.

    I decided to update the background chart on page master to change colors, etc.. All files are linked.

    Now, with funds master page updated, these pages where I added text blocks are 'buried' as on a sublayer. I checked that my Master Page background images are "sent back". I tried to wear my text boxes at the front on the Pages of my body, but they are still hidden. Interesting as the anchored frame (the icon), I attached to each NOTE or TIP point appears, but the text is not. Also, I can see and select the contours of the block... the text is hidden. If I drag the fame to another part of the document (for example, on top of another Master Page text frame sank, while the text is displayed.

    There is no image on the master page to the enclosed area. I wonder if that's what I need trouble. Just add a backstory (not attached flow)?

    Advice before I go and screw something else?

    It is what it is supposed to look like (1). Image (2) what I mean now.

    V7Page2.jpg

    V7Page.jpg

    Thanks Arnis,

    It was the property of skin! How simple... I didn't have on this subject.

    Solved!

    To answer you question, however... my approach for the construction of this new model was:

    1. I created a graph from bottom (full page) to contain the image of brand and imported/positioned.
    2. I placed the header and a footer frame and filled with content.
    3. I placed the blocks of text with streams (as a single stream in this document).

    I'm not dropping blocks of text for the content of the body... except for these tips and remarks. I don't want to use a workflow for this because I never know where they'll pop up and I want to be able to (position) specifically on each page. Is this a good approach?

    Yes, I'm aware of the continuous line down the block of text NOTE you mentioned. Originally, I had all the text within the limits. When I have updated master, all offbeat pages (only in blocks of text body page with notes/tips). I repositioned and they flow very well now.

    Thank you very much for your help continues with it. Why these problems always pop nitpciky - up to date - not when things are slow!

  • find and delete blocks of text with the same geometricBounds

    Hi writer... .new question from here:

    mySelection var = app.activeDocument.selection [0] .geometricBounds;

    alert (mySelection);

    throughout the document, I need search and delete blocks of text with the same geometricBounds.

    If possible, the same dimensions, but not the same positions.

    Thanks for the help!

    OK Bala... .in to decimal differences, some executives have not been removed.

    I solved with "Math.round' instead of 'number '.

    ===================

    mySelection var = app.activeDocument.selection [0] .geometricBounds;

    var myWidth = Math.round(mySelection[3]-mySelection[1]);

    var myHeight = Math.round(mySelection[2]-mySelection[0]); Alert (myHeight);

    var allFrames = app.activeDocument.allPageItems;

    While (t = allFrames.pop ()) {}

    {if (t.IsValid)}

    var myTextframe = t.geometricBounds;

    var myTWidth = Math.round(myTextframe[3]-myTextframe[1]);

    var myTHeight = Math.round(myTextframe[2]-myTextframe[0]);

    If ((myWidth == myTWidth) & (myHeight == myTHeight)) {}

    t.Remove ();

    }

    }

    }

    ===================

    Now, your script works great!

    Thank you very much!

  • find a block of text on the page with the name of script

    Hi all

    I need to create a script for

    find a block of text on the page with the script titled "xxx".

    and read its contents into a variable.

    The content of the text block is a number.

    Thank you

    Hello Roberto,

    Welcome to the forum,

    This is the textFrame marked on the current page.

    var myLabel = "Foo", // change to label
          myPage = app.properties.activeWindow && app.activeWindow.activePage,
          myTextFrames = myPage.textFrames.everyItem().getElements().slice(0),
          l = myTextFrames.length,
          myVariable
    
    while (l--) {
        if (myTextFrames[l].label != myLabel) continue;
        myVariable = myTextFrames[l].contents;
        break; // presuming there's only one "Foo" labeled frame on the page
        // Otherwise you'll nead an array
        }
    
    alert(myVariable)
    

    Trevor

  • CS5 - most effective way to wire and independent streams of two blocks of text in the same document?

    Greetings...

    I am responsible for creating a 100-page instructor guide and I looking for a little guidance in the use of independent text blocks that thread the length of the document.  The idea behind the use of two columns, is that the first column (left) must be used for the notes 'instructor-only', advice, etc..  The second column (right) should be used for the text of the student guide.  Two columns (or blocks of text) would need to move independently of each other.  In other words, when the left column is filled with text placed on the page, the flow of additional text in the left column on page two, left column on page three, etc.  Same thing applies to the right column.  There is no link or thread of the text between the two columns on the same page.

    I tried to reproduce this in a two-column table format, however, the table row height is limited and overset text will not continue the table in the block of text on the next page.

    Thank you in advance for your help!

    Set up master page text frames.

    If you use facing pages, put on the student to the student and executive trainer instructor on master pages.

    Be very careful when your document is redéroule however. Take a look at this discussion, we had recently on the subject:

    http://forums.Adobe.com/message/3588735#3588735

    HTH,

    Substances

  • How can I configure the element with the script names?

    Could Hello someone give me a hand?

    I created symbols on the stage of this script below.

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

    for (k = 0; k < 5; k ++) {}

    sym.createChildSymbol ("mySymB", "Stage");

    }

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

    How can I configure the element with the script names?

    Because, when I try to control a symbol by using the getSymbol("---") command.

    I need to know the name of the item given to each symbol.

    Concerning

    Yes, you're right.

    Using 'Code-Example' If you write sym.getSymbol ("mySymB") that edge returns the undefined value.

    With "Drag-and-drop-Example", you can use sym.getChildSymbols ().

  • Select all blocks of text related

    Dear all,

    My request:

    1. is it possible to select all the text frames linked to my block of text by selecting (see attachment)

    2 suppose that if we choose all the blocks of text, it is possible to set the height for all blocks of text such as 3 p or 4 p etc...

    Try the script to select all the linked text frames:

    If (app.selection [0] .nextTextFrame == null)

    {

    If (app.selection [0] .previousTextFrame! = null)

    {

    Alert ("Pass")

    App.Select (previousTextFrame.parent) & & app.select (nextTextFrame.parent) & & app.select (startTextFrame.parent)

    }

    }

    Screen Shot 2013-03-19 at 8.01.03 PM.png

    Could someone give you a solution for my application.

    Thanks in advance

    Beginner

    If you want to do is make managers of related related texts have all the same height, here's a way to do it:

    If (app.selection.length == 0) {}

    Alert ("Please select a textFrame before running this script");

    Exit();

    }

    mySelection var = app.selection [0];

    If (!) mySelection instanceof TextFrame))) {}

    Alert ("Please select a TextFrame before running this script");

    Exit();

    }

    var mySelection.parentStory = monarticle;

    var myFrames = myStory.textContainers;

    var nFrames = myFrames.length;

    for (ix var = 0; ix)< nframes;="" ix++)="">

    var myFrame = myFrames [ix];

    var limit = myFrame.geometricBounds;

    delimits [2] = limits [0] + 4;          Set the TextFrame 4 height units

    myFrame.geometricBounds = limit;

    }

    Stephen

  • CS5, blocks of text with the selection tool.

    InDesign CS5:

    I work on several documents that requires to move blocks of text.

    When I select the text block with the selection tool, my cursor will move immediately to the text tool.

    I'm not double click, only clicking once to select.

    I don't want to edit text, select only the text block, so I can move it.

    Is there a way to disable this feature?

    Or maybe a tip and Trick so the tool rest the tool selection and not switch to the type tool.

    Thank you in advance.

    Kathryn

    As stupid as it may sound, try a different mouse.

    We prefer to keep the choice to convert an empty block to a block of text, but here already are blocks of text.

    Bob

  • How can I move a block of text from the head of <>tag area within the &lt; body &gt; tag box?

    I am retarget approximately 2500 html files and a block of text should be moved to the head of <>mark the surface of the < body > tag. It must immediately follow the < body > tag. Here is an example: < h3 > heading < / h3 > < p > A bunch of text here, blah blah < /p >.  I find the block using a regular expression < >(.*?) < p > h3, but do not know what to do after that.

    If you just want to move the

    and

    on theand in thethe following regular expression work:

    (

    [\s\S]*?

    )([\s\S]*))

    Replace in the field, use this:

    $2$ 1

Maybe you are looking for