Rename Links to Single Name

Description : Rename Links - useful for batch renaming links to a single name - good for tables when link acts as a button to launch a media file or site

Download

Rename Links to Single Name

You need Onetastic Add-in
for OneNote to run this macro.
Download Onetastic
Author(s) : ben303
Category : Hyperlink
Last Updated : June 19, 2016
Requirements : OneNote 2010 or above
Screenshot :

Rename Links to Single Name

Rename Links
Scope
Changelog :

June 19, 2016 (ADB722) - ben303
Automatically upgraded to the new Macro Language

These versions are no longer supported:

July 28, 2015 - ben303
Initial version

Comments

Name
Comment
Dan - 2017-03-04
It worked thank you !

:)
Omer Atay - 2017-03-03
Dan: It looks like you haven't set anything to $hyperlink but trying to use it. It sounds like all you need to do is $Text.hyperlink = $oPage.hyperlink
Dan - 2017-03-03
Hi Omer,

I am trying to create hyperlinks to pages that contain ONLY contain  - XX in the Page Title

I have been stuck on this for days :(

<?xml version="1.0" encoding="utf-16"?>
<Macro name="Hyperlink - To Page  - IF Title Contains  XX" category="Test" description="" publishDate="00-00-00T00:00:00.000Z" version="15">
  <ForEach var="oPage">
    <Array>GetCurrentSection().pages</Array>
    <If>
      <Condition>String_Contains($oPage.name, "XX", true)</Condition>
      <Expression>$Page = GetCurrentPage()</Expression>
      <Expression>$Outline = InsertObject($Page, "Outline", -1)</Expression>
      <Expression>$Paragraph = InsertObject($Outline, "Paragraph", 0)</Expression>
      <Expression>$Text = InsertObject($Paragraph, "Text", -1)</Expression>
      <Expression>$Text.value = $oPage.name</Expression>
      <Expression>$Text.hyperlink = (($hyperlink &amp; "#") &amp; $Page.name)</Expression>
    </If>
  </ForEach>
</Macro>


The hyperlink doesn’t work
Any ideas?