Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to Hyperlink an image on the hard drive

We are converting to iMac from Windows and keep our photography business data in excel spreadsheets. Each image name links to an image on the PC hard drive. On the iMac in Numbers, I can link text in a cell to a webpage or an email but if I use the path to the location on the hard drive, it doesn't work. What I would like is to pop the image in Safari when I click the hyperlink in the Numbers cell. Example:
The iMac name is butterfly, the user is reniepoole and the path to the image is Documents/image.jpg. If I put file://butterfly/users/reniepoole/Documents/image.jpg into the address bar in Safari, it will render the image OK. If I use the same address as the URL when I try to insert the image as a hyperlink in a Numbers cell, it doesn't work. Does anyone know how to render the image in Safari from a link in Numbers?

iMac 27", Mac OS X (10.6.2), Intel Core 2 Duo 3.06GHz

Posted on Dec 27, 2009 1:32 PM

Reply
4 replies

Dec 27, 2009 7:43 PM in response to canalman

Hyperlinks in Numbers can only be to http and mailto. Hopefully they will increase the functionality of hyperlinks in the next version. You could perhaps write an Applescript that would open a file where the file address is specified in a cell. You would select the cell then run the script. You could use a keyboard shortcut if the script is a service (you can create a service with Automator and use the Applescript action for the script).

Dec 28, 2009 9:38 AM in response to canalman

Here is a script doing the trick.

--

--[SCRIPT openFileFromNumbers]
(*
Enregistrer le script en tant que Script : openFileFromNumbers.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Sélectionner une cellule contenant un chemin d'accès à un fichier.
menu Scripts > Numbers > openFileFromNumbers
Le script ouvrira le fichier.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
(* à vérifier avec Snow Leopard *)
Cochez la case "Afficher le menu des scripts dans la barre de menus".
--=====
Save the script as Script : openFileFromNumbers.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Select a cell containing a link to a file.
menu Scripts > Numbers > openFileFromNumbers
The script will open the file.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
--=====
Yvan KOENIG (VALLAURIS, France)
2009/12/28
*)
--=====
property useSafari : true
(*
true = use Unix paths and open thru Safari
example : file://Macintosh HD/Users/yvan_koenig/Documents/95.jpg
false = use HFS paths and open thru Finder
example : Macintosh HD:Users:yvan_koenig:Documents:95.jpg
*)
on run
set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
set thePath to value of cell rowNum1 of column colNum1
end tell
if useSafari then
tell application "Safari" to open location thePath
else
tell application "Finder" to open file thePath
end if
end run
--=====
on getSelParams()
local r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2
set {d_Name, s_Name, t_Name, r_Name} to my getSelection()

if r_Name is missing value then
if my parleAnglais() then
error "No selected cells"
else
error "Il n'y a pas de cellule sélectionnée !"
end if
end if

set two_Names to my decoupe(r_Name, ":")
set {row_Num1, col_Num1} to my decipher(item 1 of two_Names, d_Name, s_Name, t_Name)
if item 2 of two_Names = item 1 of two_Names then
set {row_Num2, col_Num2} to {row_Num1, col_Num1}
else
set {row_Num2, col_Num2} to my decipher(item 2 of two_Names, d_Name, s_Name, t_Name)
end if
return {d_Name, s_Name, t_Name, r_Name, row_Num1, col_Num1, row_Num2, col_Num2}
end getSelParams
--=====
(*
set {rowNumber, columnNumber} to my decipher(cellRef,docName,sheetName,tableName)
apply to named row or named column !
*)
on decipher(n, d, s, t)
tell application "Numbers" to tell document d to tell sheet s to tell table t to return {address of row of cell n, address of column of cell n}
end decipher
--=====
(*
set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
*)
on getSelection()
local _, theRange, theTable, theSheet, theDoc, errMsg, errNum

tell application "Numbers" to tell document 1
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of tables
if x > 0 then
repeat with y from 1 to x
try
(selection range of table y) as text
on error errMsg number errNum
set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
return {theDoc, theSheet, theTable, theRange}
end try
end repeat -- y
end if -- x>0
end tell -- sheet
end repeat -- i
end tell -- document
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
--


Yvan KOENIG (VALLAURIS, France) lundi 28 décembre 2009 18:38:42

Dec 28, 2009 7:01 PM in response to canalman

canalman wrote:
I wish Numbers had a browse option for a hyperlink.


Wishing here won't make it so—this is a user to user forum—but using Provide Numbers Feedback to request this feature could bring it about in a future version of Numbers.

You'll find Provide (Application) Feedback in the Application menu (first one to the right of the Apple in the menu bar) of most Apple applications. Feedback provided via this route goes directly to Apple, and is forwarded to the developers of the application (in this case, Numbers).

Regards.
Barry

How to Hyperlink an image on the hard drive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.