AppleScript and Excel: Getting row/column index, and skipping blank cells
I've spent a few hours searching the Internet and hacking together bits of AppleScript together and it's time for me to get advice from the pros. So in my Excel workbook, I have:
Column 1: URLs to images - some may be blank
Column 2: First name
Column 3: Last name
The AppleScript I'm trying to write needs to open up an Excel workbook, download the images from column 1, and rename the file using information from columns 2 and 3. Here's what I've got so far.
tell application "Microsoft Excel"
tell active sheet
tell used range
set RowCount to count of rows
end tell
set theList to get value of range ("A1:F" & RowCount) as list
repeat with theItem in theList
do shell script "curl " & item 1 of theItem & " -o $HOME/Desktop/" & item 2 of theItem & item 3 of theItem & ".jpg"
end repeat
end tell
end tell
Two questions:
1. When the script encounters a blank space, it stops. Bad! How can I get it to check for a blank cell, then skip it?
2. I want to give each file a unique name. How do I access the row/column index so I can append it to the filename?
Thanks!