ddianne

Q: Links: How does one temporarily disable links in Numbers 3.6.2?

I want to TEMPORARILY disable links in a Numbers (3.6.2) document so that I can move cells around without having my browser constantly open every time I try to do this.  Then I want to turn all the links on again. 

 

In Numbers '09 (2.3) this was possible.  In the INSPECTOR, there was an option to "Make all hyperlinks inactive."  Where is this option in Numbers 3.6.2?  I cannot find it, if it is there.  If there is no such function, why not!

MacBook Pro with Retina display, OS X El Capitan (10.11.5)

Posted on Aug 18, 2016 12:57 PM

Close

Q: Links: How does one temporarily disable links in Numbers 3.6.2?

  • All replies
  • Helpful answers

  • by SGIII,

    SGIII SGIII Aug 18, 2016 1:50 PM in response to ddianne
    Level 6 (10,637 points)
    Mac OS X
    Aug 18, 2016 1:50 PM in response to ddianne

    If there's a satisfactory way to do that, I haven't found it.

     

    You can prevent new URLs from becoming active links by unchecking Edit > Substitutions > Smart Links.

     

    To deactivate existing active links, the best I've been able to do is to first uncheck Smart Links, select cells containing links and run the script below in Script Editor (copy paste into Script Editor, in your Applications > Utilities menu, select the cells, and click the triangle 'run' button in Script Editor).

     

    But then to re-activate the links AFIK you've got to recheck Smart Links in the menu, and then go to each one, double-click to edit the cell content, and type a space at the end.

     

    SG

     

     

    tell application "Numbers"

      tell front document's active sheet

      tell (first table whose selection range's class is range)

      repeat with c in (get selection range)'s cells

      set c's value to "'" & c's value

      end repeat

      end tell

      end tell

    end tell

  • by Yellowbox,

    Yellowbox Yellowbox Aug 19, 2016 5:22 AM in response to ddianne
    Level 6 (10,455 points)
    Mac OS X
    Aug 19, 2016 5:22 AM in response to ddianne

    Hi ddianne,

    If the links are in a column, make the column wider and click in the white space to the right of a link. That will select the cell without activating the link.

    Screen Shot 2016-08-19 at 10.20.02 PM.png

    Screen Shot 2016-08-19 at 10.20.57 PM.png

    Regards,

    Ian.

  • by SGIII,

    SGIII SGIII Aug 23, 2016 2:00 PM in response to ddianne
    Level 6 (10,637 points)
    Mac OS X
    Aug 23, 2016 2:00 PM in response to ddianne

    to re-activate the links AFIK you've got to recheck Smart Links in the menu, and then go to each one, double-click to edit the cell content, and type a space at the end.

     

    It turns out that it is possible to activate/reactive links without going through each one manually!  Numbers uses a format called rtf (rich text format) to copy-paste cell information, including links, between cells. So it is possible to have a script copy a cell's contents to the clipboard, convert that to html, extract just the link part from the html, form the html for a complete link (if necessary), convert the html to rtf, and paste the rtf back into the cell.

     

    So several active and inactive links like these:

     

    Screen Shot 2016-08-23 at 4.49.52 PM.png

     

    Can quickly be batch converted into live links like these:

     

    Screen Shot 2016-08-23 at 4.51.27 PM.png

     

     

    1. Copy-paste the script below into Script Editor (in Applications > Utilities)
    2. Select the cells with the links, here A2:A6
    3. Click the triangle 'run' button.

     

    As always make a backup first, as this script will change the content of the selected cells.

     

    SG

     

    -- reactivates "dead" links or activates "link html" in Numbers cells

    -- select the cells with links and run

    tell application "Numbers"

      activate -- puts focus on app for GUI scripting

      tell front document's active sheet

      tell (first table whose selection range's class is range)

      set selRng to selection range

     

      repeat with c in selRng's cells

     

      set selection range to c

      delay 0.1

     

      -- copy to clipboard and set clipboard to the RTF class

      tell application "System Events" to keystroke "c" using command down

      set the clipboard to (the clipboard as «class RTF »)

     

      --   convert clipboard contents to html using textutil

      set theHTML to do shell script "pbpaste -Prefer rtf | textutil -convert html -stdin -stdout"

     

      --   extract the contents between <span and /span>

      set spanText to my extractSpanText(theHTML)

     

      if spanText contains "href=" then -- decode any "html entities" (&-encoded)

     

      set htmlLink to do shell script "echo " & quoted form of spanText & ¬

      " | php -r \"print html_entity_decode(file_get_contents('php://stdin'));\""

     

      else --   construct complete link in form: <a href="http://www.apple.com/">Apple</a>

     

      set htmlLink to "<a href=\"http://" & spanText & quote & ">" & spanText & "</a>"

     

      end if

     

      --   convert link html to rtf and copy to clipboard

      do shell script "echo " & htmlLink's quoted form & ¬

      " | textutil -format html -encoding UTF-8 -convert rtf -stdin -stdout | pbcopy"

     

      --   paste the rtf into the Numbers cell -- live again!

      tell application "System Events" to keystroke "v" using command down

      end repeat

     

      end tell

      end tell

    end tell

     

     

    to extractSpanText(theHTML)

      set text item delimiters to {"<span class=\"s1\">", "</span>"}

      theHTML's text item 2

    end extractSpanText

  • by ddianne,

    ddianne ddianne Aug 29, 2016 8:23 PM in response to ddianne
    Level 1 (4 points)
    iWork
    Aug 29, 2016 8:23 PM in response to ddianne

    Thanks for the responses.  I'm not that computer savvy when it comes to using scripts.  I was hoping for an easier solution.  But, you both did confirm that the old EASY method is no longer a part of the new software. Looks like I will have to write to Apple Feedback and ask them to restore the former EASY method of disabling all links at once (and restoring them all together) using the Inspector.

  • by SGIII,

    SGIII SGIII Aug 30, 2016 3:43 AM in response to ddianne
    Level 6 (10,637 points)
    Mac OS X
    Aug 30, 2016 3:43 AM in response to ddianne

    What's with the scriptophobia?  Using a script (as opposed to writing one) IS EASY!

     

    Using a script is no more difficult than using the built-in interface (or making a post here in the Support Communities). In fact it's often easier. The computer skills needed are select, copy-paste, click a button (or make a menu choice). Why not try it? You'll know within less than a minute whether it works for you; it's that easy.

     

    That said, it wouldn't hurt to give feedback to Apple via Numbers Feedback in your menu that links could be improved.

     

    But with the scripts it's quite easy to get work done in the meantime.

     

    SG