I'm trying to create a
script that will open a .txt in Excel to perform some functions. The issue I
have is simply opening the files which will be of various names. I'm very new to
Applescript (i.e. clueless), but I had used the following to open files/folders
of variable names with another software in the past, but its not working with
Excel.
display dialog "Drag
files or folders to be processed here"
on open these_items
repeat with i from 1 to
the count of these_items
set this_item to
(item i of these_items)
set the item_info to
info for this_item
if folder of the
item_info is true then
process_folder(this_item)
else if (alias of
the item_info is false) then
my
process_item(this_item)
end if
end repeat
end open
on
process_folder(this_folder)
set these_items to list
folder this_folder without invisibles
repeat with i from 1 to
the count of these_items
set this_item to
alias ((this_folder as text) & (item i of
these_items))
set the item_info to
info for this_item
if folder of the
item_info is true then
process_folder(this_item)
else if (alias of
the item_info is false) then
my
process_item(this_item)
end if
end repeat
end process_folder
on process_item(this_item)
tell application
"Microsoft Excel"
Activate
Open item this_item