Hi,
I’m trying to create a Applescript that will allow me to insert images into specific locations within Excel and have that image be a clickable image that points to a specific website or URL address. I’ve figured out how to automate the inserting of the image into Excel, but don’t know how to associate a URL or hyperlink for that image. I know how to do it manually within Excel. If I right click on an image in Excel and select Hyperlink, I can manually input a URL for that particular image in the “Link to:” field and I am then able to click on that image and it will open up my default browser and take me to that website. Can anyone help me code the piece to put in the URL automatically? Here’s my script so far
Thanks,
Ezmeralda
set mypath to (path to me as string)
set AppleScript’s text item delimiters to “:”
set theFolder to (text 1 thru text item -2 of mypath) & “:” as Unicode text
set imageFile to theFolder & “image1.jpg”
tell application “Microsoft Excel”
set imageHeight to 140
set imageWidth to 280
set theLeft to left position of cell “H29”
set theTop to top of cell “H29”
set newPic to make new picture at beginning of worksheet 1 of workbook 1 with properties {file name:(imageFile as text), height:imageHeight, width:imageWidth, left position:theLeft, top:theTop}
end tell