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

Open Multiple URLs from Excel using applescript

Hello, thanks in advance for you help.


I am trying to open multple Urls from a list in an excel sheet. When I run the script I would like it to open all the urls into differnt tabs of safari.


I have got as far as geting a single cells url to open in a new tab in safari but I can't figure out how to repeat it for the whole row.


here is what i have so far


tell application "Microsoft Excel"

open "Macintosh HD:Users:david:Desktop:apple script editor:product_search_tool.xlsx"

set myURL to value of cell "b2" of sheet "Sheet1" of document 1

end tell



tell application "Safari"

activate

try

tell window 1 to set current tab to make new tab with properties {URL:myURL}

on error

open location myURL

end try

end tell

Posted on Feb 23, 2014 1:04 AM

Reply
2 replies

Feb 23, 2014 7:02 AM in response to bone7890

...but I can't figure out how to repeat it for the whole row.


This will give you an idea of how to do that: https://discussions.apple.com/thread/5528059?answerId=23679585022#23679585022


So, If the Excel file is:

User uploaded file


Then:


tell application "Microsoft Excel"

tell active sheet

tell used range

set rc to count of rows

end tell

set theList to get value of range ("B1:B" & rc) as list

repeat with theItem in theList

tell application "Safari" to open location theItem

end repeat

end tell

end tell


Open Multiple URLs from Excel using applescript

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