C
chris1982
Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Hi Eveveryone,
I'm trying to create an Applescript that converts a txt file to a csv file. I've tried all sorts of solutions but so far none have worked. My latest try is as follows:
set theFolder to choose folder with prompt "Choose the folder that contains your Excel files"
tell application "Finder" to set theFiles to (files of theFolder)
set fileCount to count theFiles
repeat with i from 1 to fileCount
set fName to text 1 thru -5 of ((name of item i of theFiles) as text)
set tName to (theFolder as text) & fName & ".csv"
tell application "Microsoft Excel"
activate
open text file filename (item i of theFiles) data type delimited origin MSDos with consecutive delimiter and space without tab
save fName in tName as CSV Windows file format
end tell
end repeat
Right now when I run the script nothing happens after I choose the folder. I have to use all the parameters after open text file because of the type of file I'm opening.
Anyone's help would be greatly appreciated.
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Hi Eveveryone,
I'm trying to create an Applescript that converts a txt file to a csv file. I've tried all sorts of solutions but so far none have worked. My latest try is as follows:
set theFolder to choose folder with prompt "Choose the folder that contains your Excel files"
tell application "Finder" to set theFiles to (files of theFolder)
set fileCount to count theFiles
repeat with i from 1 to fileCount
set fName to text 1 thru -5 of ((name of item i of theFiles) as text)
set tName to (theFolder as text) & fName & ".csv"
tell application "Microsoft Excel"
activate
open text file filename (item i of theFiles) data type delimited origin MSDos with consecutive delimiter and space without tab
save fName in tName as CSV Windows file format
end tell
end repeat
Right now when I run the script nothing happens after I choose the folder. I have to use all the parameters after open text file because of the type of file I'm opening.
Anyone's help would be greatly appreciated.