# Changing all link destinations in a notebook

I have a bunch of cells containing text and hyperlinks. i.e. of the form:

Cell[TextData[{
"Text",
"more text"
}], "Text"]


Is there a automated way of changing all of the link destinations so that they link to the same tag as the original, but in a different file, like this:

Cell[TextData[{
"Text",
"more text"
}], "Text"]


Note that "linktag" is a different string for most of the cells.

-

Modifying Rolf's answer slightly you have.

Button["change",
NotebookPut[
(NotebookGet[EvaluationNotebook[]]) /.
ButtonData -> {"filename", x}]
]
]

-
I can't make your button work. When I select a cell and click the button (which I put on a palette) nothing happens. Does it work on your machine? And further: I tried changing "Linktext" to y_ and y to make it handle different link texts. Is that the right way to do it? –  Sofic Aug 15 '13 at 19:07
@Sofic Try it again. It should open a new Notebook containing new versions. –  William Aug 15 '13 at 19:22
Changing EvaluationNotebook to InputNotebook did the trick. Thank you for your help. –  Sofic Aug 15 '13 at 19:22
@Sofic Yeah there was a mistake. –  William Aug 15 '13 at 19:23

Create a button, e.g., like this:

  Button["change",