Add image beside the import XML content

Dear users of InDesign,

Importing text in an InDesign template (essentially in a story).

When I import this XML file do some tweaking with XML-rules, like adding a title.

function AddHeading() {}

myIdName = "AddHeading";

This.XPath = "//phoneno [1];

This.Apply = function (myElement, myRuleProcessor) {}

{with (MyElement)}

var myPhoneNo = myElement.xmlContent;

myElement.xmlContent.insertionPoints [0] .silence = String ("phone numbers \r'");

myPhoneNomentioning [0] .appliedParagraphStyle = app.activeDocument.paragraphStyles.item ("HeadingPhoneNo");

}

Returns true;

}

}

What I need to do is add an Image (a phone icon) next to the additional title ("phone numbers ').

Because everything is floating in a story, I can't have the geometric limits for this paragraph.

Any ideas how to achieve a placement of an image in this context?

Thank you!

Thanks to Peter, here is the approach solve my problem:

(adopted from pkahrel great help in this thread: Re: image of place as anchor object by finding the text...)

function AddHeading() {}

myIdName = "AddHeading";

This.XPath = "//phoneno [1];

This.Apply = function (myElement, myRuleProcessor) {}

{with (MyElement)}

var myPhoneNo = myElement.xmlContent;

myElement.xmlContent.insertionPoints [0] .silence = String ("phone numbers \r'");

myPhoneNo.words [0] .appliedParagraphStyle = app.activeDocument.paragraphStyles.item("HeadingPhoneNo");

var anchor = myElement.storyOffset.textFrames.add ();

var f = new File('/Users/PATHTOIMAGE/image.png');

var f = [0,0, "10mm", "10mm"];

var myObjectStyle = app.activeDocument.objectStyles.item ("HeadingPhoneNo");

anchor.appliedObjectStyle = myObjectStyle;

Anchor.contents = myElement.contents;

anchor.geometricBounds = GB;

Anchor.place (f);

Anchor.fit (FitOptions.CONTENT_TO_FRAME);

}

Returns true;

}

}

Tags: InDesign

Similar Questions

  • Add text to the table of contents or the skin

    Hello

    I want to add text to the table of contents that shows all the time (is not clickable).  Is it possible to display some text of infomration on the bar of navigation/table of contents?

    Or is it possible to add it to a skin it will appear at the bottom of the screen?

    Any help would be appreciated.

    Thank you!

    Hi Julie,.

    You can try the project--> TOC--> Info it will open a dialog box where you can enter information about your organization, as well as a logo.

    In addition, if you wish, you can change a TOC and their default legend items.

    To do this, close Captivate.

    Open Notepad-

    Paste below-

    [TOCStrings]

    SlideTitle = Module name

    Time = time

    Status = status

    MoreInfo = my info

    Clear = Wipe

    ClearToolTip = State of Wipe

    BookMarkToolTip = book-marking

    NoSearch = String not found

    CurrTime = what

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

    Save it as TOCStrings.ini

    and place this file in the location of the Adobe Captivate installation on your machine.

    Now launch and add a table of contents to the Porject and preview or publish and see the change.

    Thank you

    Anjaneai

  • How can we change all the images in the import of ref file to copy into the doc?

    Y at - it an easy way to change all the images in a file 'import by reference' to 'copy in the document '?

    The way I currently have to do is delete and re-import and resizing an image at a time and even in a

    single document with 30 images, this can take forever! Surely it more soon than that?

    My company has always used the "Import by reference" option when you add images to our frame documents.

    But things have moved on and we are now a global business and send a large number of these files to our sister sites.

    E mailing 1 file is much more logical to emailing file 1 framework and 40 image files, especially when files

    are in a different folder structure.

    ACE,

    You have a lot of good advice here on best practices, but I don't think that someone at - it answered your question. The answer is no, there is no way easy, unless you have access to the FrameScript or the FDK.

    Russ

  • Add images in the videos?

    Hello, I was trying to figure out how to add an image in a video during playback on iMovie, as when people censor part in a video (playing) and put a safety edge or black bar, can someone help out me? It is even possible on iMovie? If so will you please show me how? Thank you.

    You can use the image based on the photo of the for do in iMovie 10.1.2 (latest version).   Both earlier versions.

    10.1.2 place your image above the time line and select it.  In the toolbar at the top of the screen, click the button that looks like to the overlap of the squares. In the menu on the left, select image in the image.   Your photo will appear as an insert in the preview screen.  You can resize and move around. Then click on the reset button to the right.

  • How to add lines to the PresetEffects.xml from a script

    Hi, I would like to add a few lines in the PresetEffects.xml to another text file or an another JavaScript add lines like this how can I do? :

    < name of the group = "$$$ / AE/Preset/AnimalHead14 / = mouth" >

    < name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthOffsetX = mouth X shift" default = '0' valid_min = '-30,000"valid_max ="30000"slider_min = slider_max"-500"= '500' precision ="1"DISPLAY_PERCENT ="true"/ >"

    < name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthOffsetY = mouth Offset Y" default = "0" valid_min = "-30,000" valid_max = "30000" slider_min = slider_max "-500" = '500' precision = "1" DISPLAY_PERCENT = "true" / > "

    < name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthScaleWidth = scale Overture" default = "100" valid_min = "-30,000" valid_max = "30000" slider_min = slider_max '-500' = '500' precision = "1" DISPLAY_PERCENT = "true" / > "

    < name of the cursor = "' $$$ / AE/Preset/AnimalHead14/MouthScaleHeight = scale of mouth height" default = "100" valid_min = "-30,000" valid_max = "30000" slider_min = "-500" slider_max = "500" precision = "1" DISPLAY_PERCENT = "true" / > "

    < / Group >

    < / effect >

    {function onClick.btn

    Add the lines of my text file in the PresetEffects.xml

    I did once, like this:

    var scriptEffect = {};
    scriptEffect.xml =
    
        
            
            
        
        
            
            
            
        
    ;
    scriptEffect.matchName = [email protected]();
    
    function installScriptEffect(){
    
        var ret;
        var file = new File(Folder.appPackage.absoluteURI + "/PresetEffects.xml");
        var str, idx, header, xml;
        var xmlSettings = XML.settings();
    
        XML.setSettings(XML.defaultSettings());
    
        try{
            if (!file.exists) throw "ERR_FILE_NOT_FOUND";
    
            file.open("r");
            str = file.read();
            file.close();
    
            idx = str.indexOf("");
            if (idx<0) throw "???";
    
            header = str.substring(0, idx-1);
            xml = new XML(str.substring(idx, str.length));
    
            if (!xml.contains(scriptEffect.xml)){
                xml.appendChild(scriptEffect.xml);
                if (!file.copy(new File(file.absoluteURI+".bak"))) throw "ERR_CANNOT_WRITE";
                file.open("w");
                if (!file.write(header + xml.toXMLString())) {file.close(); throw "ERR_WRITE_FAILED";};
                file.close();
                alert("Preset installed succesfully. Please restart After Effects");
                }
            else{
                alert("Preset already installed. You need to restart After Effects to make it effective.");
                };
            ret = true;
            }
        catch(e){
            file.close();
            alert(e);
            ret = false;
            };
    
        XML.setSettings(xmlSettings);
    
        return ret;
        };
    

    Then, when you want to add the effect, check with myLayer.effect.canAddProperty (scriptEffect.matchName).

    If true, nothing to do, otherwise use the installScriptEffect function. Normally, it works (haven't tried for a long time).

    Xavier

  • How to add images of the icon to the button of the custom tool

    Hello

    Can any one help to add the image to the button of the tool customized in adobe reader?

    Thank you

    Ma'ariv

    In the preferences to activate the entry "see the console on errors and messages.

  • Adobe Lightroom 2015.2.1 - cannot access the images using the import option "browse the computer."

    Hi all

    I just downloaded and installed Lightroom 2015.2.1. When I click "Import", I gives me a few options to choose from, one of them is "browse the computer." Choose this option by opening the folder that I need, there is no images displayed and the folder appears empty with a title "no element not corresponding to your search. This is true for ALL folders on my computer.

    What's weird, is that if I click on "selecting a folder" at the lower right part of the window, the pictures in this folder will BE imported even though when the folder is opened, they are not displayed. However, I want to select specific images and does not import the entire folder.

    What happens and how can I fix?

    I saw another thread with a few days of a person having the same problem, but without a fix.

    "Browse computer" only shows you the folders.

    Select a folder by clicking with the mouse, click the [Select Folder] button, then the import window will show the files in this folder, where you can select/Disable-preset images.

    The window shows "no found photos" If the folder is empty OR the images were previously imported.

  • How can I add images to the composition of the lightbox

    There used to be a small file in the composition of light box widget to add images. How can I add them now?

    Hello

    Take a look at this step by step article

    Adobe help Muse | Working with widgets of Composition

  • Problem with the scale of the images during the import.

    I took 250 pictures which I've edited in a film in stop motion. However, I encountered some problems.

    The biggest problem is that when I imported the images in the timeline, they were strongly increased and not even centered in the frame. as you can see in this screenshot:

    ffdsdgsfgd.jpg

    It is a big problem. You would think that I wouldn't have to go through every signle image and resize it down to properly adjust the setting... good? She has not even centered which means that I have to scale and move and be very precise and it's going to take so many hours to do! What is the problem here, how can I do so that when I import images, they are at the right scale?

    problem 2: when I put the images in the scenario that they were 'backwards '. As in, the last image was the first in the chronology and the first image was the last. It's as if the program TRIES to make my life a living hell.

    Daniel, in order to solve your problem, in principle, you should not import your numbered stills in the form of unique images, you must import them as a sequence - tick 'numbered Stills' checkbox in the import and Bob from your uncle - PrPro dialog box will deal with all of these images as a single sequence.

    Go to Edit-> preferences-> Media-> Timebase of media for an indefinite period and desired default rate. In order to change the framerate of already imported image sequence select it in the project Panel, right-click and choose change-> interpret the film...

    Length default for still images is also set through preferences: Edit-> preferences-> General-> still Image default duration. To change the duration of all the stills in your timeline select all, right click, choose speed/duration and set the duration to 1 framework for example. Don't forget to check the Ripple edit, move the creeping Clips .

  • File in the import XML dialog box?

    Question fast and easy if all goes well:

    What is the javascript format to select an XML file manually? I know that's not it:

    / * Import XML manually

    myDocument.importXML is File.openDialog ("choose the current XML file");.

    */

    I have my project works well, but I decided to get the user to manually select the XML in case they have uploaded a second version, named (for example) data - 1.xml and not "Data.xml". It is up to them to choose the most up-to-date XML, then we can also name the XML with a datastamp.

    Thanks for this any any other help on this forum - I have pretty little hair out because it is...

    Simon.

    Hi Simon,.

    Can you please try the JS code below and let me know if you have any questions all.

    var myDoc = app.activeDocument;
    var myXMLFile=File.openDialog("Choose the current XML file");
    myDoc.importXML(File(myXMLFile));
    myDoc.xmlElements[0].placeXML(myDoc.pages[0].textFrames[0]);
    

    THX

    csm_phil

  • How to add tags in the existing XML file?

    Hello
    I have a requirement in which I need to add a tag to the existing xml data.

    For example:
    < ROW >
    < EVNT_ID > 7333976 < / EVNT_ID >
    < DISTRCT_CD > 67 < / DISTRCT_CD >
    < TIME_OFF > 6 May 2008 10:50:04 < / TIME_OFF >
    < / ROW >

    The desired output is,

    < DI_DATA >
    < ROW >
    < EVNT_ID > 7333976 < / EVNT_ID >
    < DISTRCT_CD > 67 < / DISTRCT_CD >
    < TIME_OFF > 6 May 2008 10:50:04 < / TIME_OFF >
    < / ROW >
    < / DI_DATA >

    I must add < DI_DATA > < / DI_DATA > at the beginning and end of the entry.

    Anyone of you could help me with that?

    Thank you
    GV

    If your XML is just in a CLOB, you can just use manipulation of strings to add/add nodes on. If you have it in an XMLType you could just do the following

    select appendchildxml(XMLTYPE(''),
                                  'DI_DATA',
                                  XMLTYPE('
    7333976
    67
    06-May-2008 10:50:04 AM
    '))  -- this would be your variable
      from dual;
    

    which will put your data in the DI_DATA node.

  • Add images to the Manager of the screens.

    Hello

    My screen is a screen, and I have a title and a status of the screen. I want to put the image to fit the middle section of the Manager. I don't need to know how to scale an image I know how to do this. All I need is how to central section width and height to resize the image to fit perfectly.

    Unfortunately you won't know that until the moment of the page layout.

    The way I think than anything approaching whether to put a scroll not use all height and width Manager in the 'middle' bit and paint the image sized as the background to that.  do the scaling in the context of the sublayout.  You will need to add all your fields to this optimization of resources, rather than just for display.

    In other words, the highlights, the best place to look for details and probably a better explanation is here:

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

  • How to add images to the TextArea or TextField

    Hello

    I want to add some custom emotion of image to my textarea or textfield.

    I try to user with textarea html but they do not support tag.

    How to do this

    Emoji are supported by all text controls Cascades. See the Emoji section at this link to the documentation for more details on how to use Emoji. However, unfortantely, there currently no API to load custom emoticons.

  • How to add images to the pop-up screen?

    How can we add popup screen images?

    the image should cover the screen whole popup.

    How can I substitute popupscreen so that I can change the look of popupscreen.

    Finally, I found the solution.

    We can add BitmapField directly to the class that extends popupscreen.

    Thankx

  • How can I add images to the Pages of the Apex?

    Hi all
    Can someone tell me how to add an image to a Page of the APEX? We have an application that is ready to be deployed, but bed looking a bit spartan. Its a finance app but some graphics would be nice.

    We have uploaded an image named ID - 10038362.jpg for the shared components > application Images. Reference on page 101 > Log In HTML area > attribute region Image < img src = "ID-10038362" >

    We are on APEX 4.1.

    Any help would be appreciated.

    Thank you

    lilhelp wrote:
    Hi all
    Can someone tell me how to add an image to a Page of the APEX? We have an application that is ready to be deployed, but bed looking a bit spartan. Its a finance app but some graphics would be nice.

    We have uploaded an image named ID - 10038362.jpg for the shared components > application Images. Reference on page 101 > Log in HTML area > attribute region Image

    We are on APEX 4.1.

    #WORKSPACE_IMAGES#ID-10038362.jpg
    

Maybe you are looking for

  • How can I remove the bookmarks on the left side panel and put it back on the bar?

    I'm not used to the favourites being in a Panel on the left or right side of the window of FF. I use tabs for the places I visit and use Roboform to complete registration for a particular website of my choice. All the bookmarks that I desire in Robof

  • Email rescue unaudited; I forgot security... Help!

    I forgot my answers to security questions, and I tried to reset it by using my email to relief. But I have not checked and when I click on "address of e-mail use on the rescue", it won't work because it is not verified... help, what should I do?

  • selected song is not the song that plays

    On some, not all, my songs I select the one is not the one who plays.  It will play music from the same album, but not the title that shows.   First I thought that it would be something in the cd that I burned.  But it happened again.  Only a few alb

  • dv7-3173nr wireless card

    I'm looking for a list of the cards approved for my dv7-3173nr wireless. I think that the my current card (AR9285) goes out, due to the fact it will be his car since the wifi network-disconect and does not connect unless I run troubleshoot. I know th

  • Data store to the way policy script host

    Hi allI use this little script to identify the host LUN political path and status, but hoped someone could help to change the LUN list with a naa starting with naa.600500* and rather than list the lunName data store name?$lunpathinfo = @()foreach ($v