Move all of the URLS in the text for references

Hello world

I have an interesting little problem. Basically, I have a text in which all URLS are displayed in the format < URL > < URL > www.example.org and I want to spend these coins - preferably without the < URL > - tags to references. So I decided to do this and I got far enough. I can create empty notes for each instance of < URL >(.+?) < / URL > but then when I want to move the text, I'm stumped on how to define what text should be moved without losing the location of the note to the text. So here's what I have:

href() {} function

var curSel = app.selection [0];

current selection is that the script is looking through

var searchTerm = "< URL >(.+?). < URL > ';

Search term such as variable to facilitate the eventual later use

app.findGrepPreferences = app.changeGrepPreferences = null;

Reset the search parameters

app.findGrepPreferences.findWhat = searchTerm;

Search searchTerm

var result = curSel.findGrep (true);

app.findGrepPreferences = null;

for (var f = 0; f < result.length; f ++) {}

f is defined as 0, but if there are no more results than 0, increments f by the number of results

curRes var = result [f];

Defines curRes as the number of results f-> last occurrence of searchTerm in selection

var curFootnote = curRes.footnotes.add ();

Creates an empty reference of last instance of < URL >. + ? < URL >

moveURL.move (LocationOptions.AFTER, curFootnote.insertionPoints [-1]);

}

app.findGrepPreferences = null;

}

I apologize for the rather silly sounding commenting in it, but I'm trying to make sure everyone with a bit of JavaScript knowledge knows that I do.

As you can see, moveURL var is not set. var moveURL would be the function where I define the text that needs to be moved. Now, he can't be curSel because who would try to move all the text in the reference, which is just stupid for obvious reasons. curFootnote is not, because it generates the note. So what I'm doing wrong here?

Thanks for your help!

You don't need an 'intermediate' at all moveURL.

The problem occurs because you add a new reference to the found object (curRes) - you can see if you add this after line of footnote.add:

curRes.select();exit();

(so please withdraw again, this is only to show how to check what is the problem).

You can fix this, oddly enough, by adding the note before the target text:

var curFootnote = curRes.insertionPoints[0].footnotes.add();

If you check with the trick 'select', you will see the found text "curRes" still only constituted the part of the URL and the new reference appears right in front of him and not inside. When you add a note "at the end", to help

var curFootnote = curRes.insertionPoints[-1].footnotes.add();

you will find the note becomes an integral part of the "curRes" and if you can't its text more move in this same note.

With that, it's child's play to move the text found in the note, but then you still have to remove the markers of the URL. There are several approaches, but I will copy only the text in the note, then by removing all of the text found in the document, like this:

curRes.characters.itemByRange(6,curRes.characters.length-5).duplicate(LocationOptions.AFTER, curFootnote.insertionPoints[-1]);
curRes.remove();

Tags: InDesign

Similar Questions

  • Glimpses of well site in Firefox locally, but when I published the site all of the text is the wrong size

    I'm a web designer from recruit. I recently created a site using CS6. http://www.joshuahetzler.com when I presented a preview site in Dreamweaver, it seemed fine in Firefox and IE. I published the site and now it is messed up in Firefox. All of the text is the wrong size. Does anyone know how to fix this? It has something to do with my hosting provider? (I deleted a wordpress site in the directory a hourago and put this new site in its place) Why IE will display correctly, but not Firefox...

    Caused by a bad link to your site's CSS file.  It's pointing to a file on your hard disk local that no one but you can see.

    Open your template and reconcile the path to the folder of your site.  Probably, it should look like this:

    Save the model.  Fill out the changes made to the pages of the child.  Download the child pages.

    Nancy O.

  • When using the 'tools', 'Interactive objects', 'Add a button', how to make the text for the button name is displayed? I have tried everything and only the background, or lacxk, appears.

    I created a pdf document using Adobe Acrobat XI base and want to put a link on each page, return to the table of contents. However, the tool "Add a link" I cannot place this link on each page at a time. Accordingly, I used the tool 'Add a button' interactive Actions that allows me to do what I want. However, when I enter the name of the button, add background color (or not) and register, the name of the text for the button does not show, only the background appears (or nothing if I select no background). The button works, it just is not labeled. Any help will be appreciated.

    This is the area of the label, under Properties - Options.

    The game, 23:02, charlesc90551452, [email protected] , 14 may 2015

  • Firefox 4.0.1 shows almost all of the text in bold. I start to record mode and sound fine, but when I disable all the addon then start in normal mode it broke again.

    So I updated last night, this morning I noticed that a lot of the text on Web sites are in bold.
    For example when doing web yahoo mail unread messages must be "BOLD", while read messages shouldn't be now, they are all "BOLD" anything.
    I started in safe mode, thinking that an addon was broken and at the normal search that seemed to confirm that.
    So I disabled all the addon and manually restarted in normal mode, the problem was back.

    I confirmed all was the addon still handicapped and restarted in safe mode once again, fixed... so I disabled both the plugin and extensions... still broken in normal mode.
    At one point I thought it might be the default aspect so I downloaded one that looks like 3.6 and this one broke... again.

    So that's what I'm wondering, what is not loaded in safe mode which is always loaded when you manually turn off all extensions and plugin?

    This could be a problem with the new features related to the police who are trying to use your graphics card. You can enable those here:

    Tools > Options > advanced > [disable] "use hardware acceleration when available.

    (It's one of the things that turn off safe mode.)

    I don't know if you'll see results immediately, or if you must restart Firefox.

  • How to highlight all of the text control / seeing?

    I need a VI, just by pressing a button I could selects all the text in the control or the indicator to be able to copy then pressing CTRL + C.

    I tried to play with the property with selection of startup, select the end node, but no results.

    Also did not find any documentation or examples on how to highlight the text in the indicator.

    Could someone help with this?

    Any tips/tip much appreciated.

    Thanks in advance.

    Help for 'selection' mentions that you have to set the Focus to the first control.

    There is also a System method to copy a string into the system Clipboard.

    Tone

  • How to display all of the text in ListField

    I have a liftfield displaying messages long, but for some reason they get any shorter. For example, if the message is 'This is my example message.', the Simulator displays: "this is...". ».

    Is there a way to make sure the entire message is displayed?

    Thanks in advance!

    Frankly, you don't need as many pointers. Take a look at the Graphics class and start thinking about what you want to draw and what positions. There are several methods of drawText in there - read descriptions and choose the ones you need. A little advice - adjust your font size before drawing if you see that the text does not.

    Here is a (very incomplete) list the things that you may need:

    Graphics.setFont / Graphics.getFont

    Graphics.drawText

    Graphics.setColor / Graphics.getColor

    Police .getHeight

    Font.getAdvance

    Font.DERIVE

    Read the documentation and try to see how it all works together.

    Also search the ListField forum and/or drawListRow - you're bound to find a lot of good pointers.

  • All of the text is now a link and I can't remove it

    Muse has suddenly decided that all text on a single page is an important link. If I select the text and click the 'x' in the box link to remove it, it will look as if the link has been removed. And then in a moment it immediately reappears as a huge link again. I did not this text a link, and now I can not remove it. Any advice?

    Finally found the answer myself... it turns out that become whole text block in some way a link as well. Click on the image, remove the link. Problem finally solved!

  • All of the text I entered is red.  How can I change to black?

    I'm filling out a form.  I had to do this by copying the text boxes and change the info in each box.  All the text is red.  I figured out how to remove the borders (red), but I can't understand how to change the text in black.  Can anyone help please?

    Hi sandien,

    Try this: -.

    Right click on the text in the text box and select Properties, now, to change the color.

    Kind regards

    Nicos

  • Paragraph styles changing all of the text, not only selected text

    Hello, I'm using CS5, InDesign, on a Mac and I'm having a terrible time applying my paragraph styles in the imported Word document. The main problem is when I select text to apply my paragraph style to, the style is applied to all the text in the thread of the text in InDesign. The solution I understood is to go in Word, cut and paste each section on Word, a new Word document and be sure to 'Paste special' and select 'text style' in Word. Then, I am able to apply for the different sections of text paragraph styles when it is imported into InDesign. The only problem is that all hyperlinks are removed and I must now enter and put them all by hand. It is well over 100 hyperlinks in this ebook. I spent 4 hours trying to solve this problem. There seems not to be a conflict of style when I import the Word document and I am sure no paragraph or character styles are selected when I put them the text. I changed the options "next style" in paragraph stlyes and which seems not helped either. This would be a matter of Word?

    That sounds to me like you have separte paragraphs, but have line breaks forced in the place where the paragraph breaks must be. You can check that by showing the nonprinting characters.

  • JavaScript: select all of the text, break the link style

    Hello

    I want to select all the text in a Document (in different independent text boxes) and then break the link of his style (in the program in the paragraph styles dropdown)

    Is this feature that can contain a script (javascript)?

    How to select all the text?

    InDesign CS6, OS10.7.4

    Thank you

    Hello

    app.activeDocument.stories.everyItem (). texts.everyItem () .applyParagraphStyle (app.activeDoc ument.paragraphStyles.item (0), false);     This should be applied [none] formats paraStyle and keep. the same charStyles.

    Your goal will be reached with the exception of the formats defined by using the definition of paraStyle info NestedStyle (GREP, NestedLineStyle)

    ==> those who disappear, I'm afraid.

    I hope that...

  • text won't move correctly when the text box is moved, how to fix?

    Working with someone elses files and it seems that he has a setting enabled in his ID CS4 that we cannot understand.

    It has a text box with text on a document.  When you move the text box upward or down with the arrow keys, the box moves, but the text does not.  When you move upward or downward far enough, the text seeks to realign itself back in the box.  The best description of it is as if there is an invisible box above and below with wrapping turned on... but I know its nothing like that.  What is the cause?

    Looks like line up on the starting grid...

    Bring up the grid with view-> grids and Guides-> display base grille.

    Change the grid settings in Edit-> preferences-> grids

    In a paragraph style, go to the withdrawal and spacing to change the settings for alignment grid

    If your text has no style paragraph assigned... uh... uh... I have no idea how turn it off

  • How to move all of the FORM to a Web service?

    What is the proper way to pass all of the form to a Web service? I can do my work of CFCS with 1 param, who is the FORM, but when I try to use the CFC as a Web service I get a type mismatch error. The must be a way to pass all of the form to a Web service rather than to me, creating a bunch of parameters for each element of the form, I just can't find an example of anywhere. I know I can't be the only person to ask this question.

    ..

  • No sound when don't receive the text for a single contact.

    My iPhone6 does not play a sound for one of my contacts when a text is received.  Others make it sound when the text is received.  Any ideas why this happens?

    HI there, milford dennisfromnew!

    Thank you for using communities Support from Apple. After reviewing your post, I see that when you receive an SMS from a particular person, you don't get notification sounds. I use Messages every day to keep in touch with friends and family, so I know how important it is to make sure you get all your notifications and would be happy to help you!

    It is possible that you cut your conversation with this person. The section "Mute conversations" in the following article will give you more details on where to control and how to enable and disable.

    Use Messages with your iPhone, iPad or iPod touch

    The information is:

    Silent conversations

    To no longer receive message notifications, you can cut off conversations. In the Messages, go to the conversation you want to turn off notifications for. Then click details and turn on do not disturb. When do not disturb is activated,will appear next to the conversation. This interruption of the notifications only for this conversation to message, not your device. Always you receive all messages and see notifications for them on your lock screen.

    You can also cut all your conversations by turning on do not disturb in settings. Go to settings > do not disturb and tap manual or programmed. This will stop all notifications on your device.

    Happy texting!

  • convert the text to reference

    8. to get more when [1] partnerships with civil society so that the human rights advocates feel full [2] supported normal EU;

    [1] Human Rights WATCH: Central Asia: five years of commitment to the EU

    [2] http://www.senat.fr/rap/r96-2013, 1054/r96 - 374.html.

    It is a small sample of text xml we receive from external sources. There is no link between the false "note-ref [1]" text and the false "text of the note.

    Is it possible to convert these 'notes' real notes text, but not to the end-notes? Sometimes, this kind of remarks extend to more than 100.

    Thnkx

    Hello

    Just to show the way:

    var
        myDoc = app.activeDocument,
        mStory = myDoc.textFrames.item("story").parentStory,
        mEndNotes = myDoc.textFrames.add( {name:"EndNotes"} ),
        k, len, cIP, currPara, currFoot, mMarkers;
    
    app.findGrepPreferences = app.changeGrepPreferences = null;
    //---------------------------------------------
    // edit doc.footnoteOption here
    with (myDoc.footnoteOptions)
        {
        showPrefixSuffix = FootnotePrefixSuffix.PREFIX_SUFFIX_BOTH;
        prefix = "[";
        suffix = "]";
        separatorText = "\t";
        markerPositioning = FootnoteMarkerPositioning.NORMAL_MARKER;
        }
    //------------------------------------------------------------
    // move endnotes to a separate textFrame
    for (k=mStory.paragraphs.length - 1; k >=0; k--)
        {
        if (mStory.paragraphs[k].contents.search(/^\[\d+\]/) == 0)
            {
            currPara = mStory.paragraphs[k].move(LocationOptions.AT_BEGINNING, mEndNotes.parentStory);
            currPara.words[0].remove();
            }
        }
    //--------------------------------------
    // create footnote markers
    app.findGrepPreferences.findWhat = "\\[\\d+\\]";
    mMarkers = mStory.findGrep();
    len = mMarkers.length;
    while (len-->0) {
        cIP = mMarkers[len].insertionPoints[0].index;
        mMarkers[len].remove();
        mStory.footnotes.add( LocationOptions.AFTER, mStory.insertionPoints[cIP] );
        }
    //-------------------------------------------------------
    // fill footnote contents with proper text
    for (k=0; k < mStory.footnotes.length; k++) {
        currFoot = mStory.footnotes[k];
        mEndNotes.paragraphs[0].texts[0].move(LocationOptions.AT_END, currFoot.texts[0]);
        if (mStory.footnotes[k].characters[-1].contents == "\r") mStory.footnotes[k].characters[-1].remove();
        }
    
    mEndNotes.remove();
    

    Assumings:

    • text and endnotes are in the same story
    • one of the textContainer of this story is named 'history '.
    • each note is a paragraph separate (a)
    • Initially, there is a white space after number of endnote

    Jarek

  • How to change the text for the lightbox 1.0 widget

    I installed a lightbox 1.0 widget that simply shows a larger version of a thumbnail when clicked and then allows for navigation to the next thumbnail with the controls on the image itself.

    How can I add text individualized for each photo when she grows a thumbnail? I am able to go to the presets tab of individualisation and widget before installing, edit the text that is fixed to "photo x of y" by default, but it applies to all images.

    Screen shot 2011-06-29 at 8.23.22 PM.png

    I thought I might be able to do by finding the code, once installed, but I couldn't find it.

    You can send to the author by http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=2127022

    GRAMPS

Maybe you are looking for

  • Satellite L300 - cannot install Vista - HARD drive not detected

    My laptop model is Satellite L300. Model No.: PSLB0E-06U01HAR. I am facing problem with Windows Vista Home Basic.In the middle of the instalation, it does not detect the hard drive.Its shows me the error that is your hard drive erased or not connecte

  • Graphical evolution of positions programmability

    Is there a way to change chart position based on a State of your VI? For example: I want to spend two charts based on a type of test. The cards are of different sizes. I know I can just wire the cards in my code, but what changes should I make labels

  • How to run older versions of programs on my desktop HP pavilion model P6516F

    I saw the button click to run older versions of the programs, but now I can not find.   How can I get my computer to run older versions of programs.  Specifically, I designed a website on my old desk and this program, Yahoo Sitebuilder will not work

  • How to remove the administrator user

    I create a user administrator using cmd.exe. The command is"net/active: Yes"user "Administrator" password"{enter}". Now I want to delete this account, but I can't delete it anywhere, as the user accounts and parental controls as well as cmd.exe"net u

  • Cannot connect to the MVA

    Hello I registered a new account, and I see that I could log in: https://account.live.com/, profile.live.com, outlook.com (and receive emails too) etc.   But when I login on the AFM website, and exactly when I click the OK button on this page (Leave