I am trying to create a script that will pull values from a specific column in an Excel document and create folders in Finder from those values. For my test document you can see below, it starts in row 6 and ends on row 100.
My AppleScript is a little rusty but I think I’m pretty much there…
tell application "Finder"
tell application "Microsoft Excel"
set x to 6
set CellName to "B" & x
set folderPath to (alias "Leopard HD:Users:jbryan:Desktop:Draft 02: H - K")
repeat until CellName is "B100"
set CellName to "B" & x
set CustomerName to value of cell CellName
try
make new folder with properties {name:CustomerName} at folderPath
on error
display dialog "There was an error."
return
end try
set x to x + 1
end repeat
end tell
end tell
Any suggestions? I keep getting errors and no folders.
tell application "Microsoft Excel"
set x to 6
set CellName to "B" & x
set folderPath to ("Leopard HD:Users:jbryan:Desktop:Draft 02: H - K") as alias
repeat until CellName is "B3"
set CellName to "B" & x
set CustomerName to value of cell CellName
try
tell application "Finder"
make new folder at folderPath with properties {name:CustomerName}
end tell
on error
display dialog "There was an error."
return
end try
set x to x + 1
end repeat
end tell
Just so I understand, changing the spot of the Finder call didn’t really fix this right? It seems more like it has to do with the “as alias” you added to my destination folder and the order you changed the “create folder” line to. Right?