The download is done manually from within the online banking i.e. click "Download" to download the statement file. However the folder option s an excellent suggestion and one I'd overlooked :-) I'll have a play now.
For anyone finding this when looking for QIF to OFX conversion on google here is the script below. Use as you wish, if it breaks anything, it's not my fault ;-) Can be tweaked to prompt for file to open. I can't get the formatting right here...but you get the general gist.
on open TheDroppedFile
--set QIFstr to "Please locate your CSV file..."
--set QIF_File to (choose file with prompt QIFstr) as text
-- save ApplesScripts delimiters current state and setup variables
set Old_Delims to AppleScript's text item delimiters
set Save_Date to "00-00-00"
set OFX_Data to null
set OFX_Data1 to null
set OFX_Data2 to null
set OFX_Data3 to null
set FITID_Data to null
--Extracting the account number from the source file name NOTE This is dependant on the naming convention used by your bank
set QIF_File to TheDroppedFile as text
set Acct_Num to text ((offset of "_" in QIF_File) + 1) thru ((offset of "_" in QIF_File) + 8) of QIF_File
-- Set the file to write to
set OFX_File to (open for access file (((path to desktop) as string) & Acct_Num & ".ofx") with write permission)
-- write header concat file name with header record
set OFX_Header to "OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE
<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<DTSERVER>20991231000000[-5:EST]
<LANGUAGE>ENG
</SONRS>
</SIGNONMSGSRSV1>
<BANKMSGSRSV1>
<STMTTRNRS>
<TRNUID>1
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<STMTRS>
<CURDEF>GBP
<BANKACCTFROM>
<BANKID>999999
<ACCTID>" & Acct_Num & "
<ACCTTYPE>CHECKING
</BANKACCTFROM>
<BANKTRANLIST>
<DTSTART>20000101000000[-5:EST]
<DTEND>20991231000000[-5:EST]
" as string
write (OFX_Header) to OFX_File starting at eof
-- Reading your file in to memory
set QIF_Records to paragraphs of (read file QIF_File)
-- Read through records and write out correct OFX standard
repeat with i in QIF_Records
-- Check for EOF NOTE: This is dependent on how your bank ends the file
-- if (offset of "^" in i) = 1 and length of i = 1 then
-- exit repeat
-- end if
-- Create DTPOSTED records
if (offset of "D" in i) = 1 and length of i > 1 then
set OFX_Data1 to "<DTPOSTED>" & "20" & (text 8 thru 9 of i) & (text 2 thru 3 of i) & (text 5 thru 6 of i) & "000000[-5:EST]"
end if
-- Create FTID record from DTPOSTED date and increment counter by 1 padded with zeros
if (offset of "D" in i) = 1 then
if Save_Date = (text 2 thru 9 of i) then
set FT_ID to FT_ID + 1
else
set Save_Date to (text 2 thru 9 of i)
set FT_ID to 1
end if
set FITID_Data to "<FITID>+" & "20" & (text 8 thru 9 of i) & (text 2 thru 3 of i) & (text 5 thru 6 of i) & add_leading_zeros(FT_ID, 5)
end if
-- Set TRNTYPE to PAYMENT or OTHER depending upon sign
if (offset of "T" in i) = 1 then
if (offset of "-" in i) = 2 then
set OFX_Data1 to "<STMTTRN>" & return & "<TRNTYPE>PAYMENT" & return & OFX_Data1
else
set OFX_Data1 to "<STMTTRN>" & return & "<TRNTYPE>OTHER" & return & OFX_Data1
end if
-- Check length of transaction amount text and strip out , if present
if i contains "," then
set AppleScript's text item delimiters to {","}
set Delimited_List to every text item of i
set AppleScript's text item delimiters to {""}
set i to Delimited_List as string
set AppleScript's text item delimiters to Old_Delims
end if
set OFX_Data2 to "<TRNAMT>" & (text 2 thru (length of i) of i)
end if
-- Check length of text transaction description text and strip out & if present and prior to position 29
if (offset of "P" in i) = 1 then
-- if length of i < 34 then
set Tran_Desc_Length to length of i
-- else
-- set Tran_Desc_Length to 33
-- end if
-- if i contains "&" then
-- if (offset of "&" in i) < 30 then
-- set AppleScript's text item delimiters to {"&"}
-- set Delimited_List to every text item of i
-- set AppleScript's text item delimiters to {"&"}
-- set i to Delimited_List as string
-- set AppleScript's text item delimiters to Old_Delims
-- else
-- set Tran_Desc_Length to (offset of "&" in i) - 1
-- end if
-- end if
set OFX_Data3 to "<NAME>" & (text 2 thru Tran_Desc_Length of i) & return & "</STMTTRN>"
end if
if not (OFX_Data1 = null or OFX_Data2 = null or FITID_Data = null or OFX_Data3 = null) then
set OFX_Data to OFX_Data1 & return & OFX_Data2 & return & FITID_Data & return & OFX_Data3 & return
write (OFX_Data) to OFX_File
set OFX_Data to null
set OFX_Data1 to null
set OFX_Data2 to null
set OFX_Data3 to null
set FITID_Data to null
end if
end repeat
set OFX_Footer to "</BANKTRANLIST>
<LEDGERBAL>
<BALAMT>00.00
<DTASOF>20991231000000[-5:EST]
</LEDGERBAL>
</STMTRS>
</STMTTRNRS>
</BANKMSGSRSV1>
</OFX>" as string
write (OFX_Footer) to OFX_File starting at eof
set AppleScript's text item delimiters to Old_Delims
do shell script "rm " & quoted form of the POSIX path of QIF_File
tell application "Finder"
--activate
open file (((path to desktop) as string) & Acct_Num & ".ofx")
set Del_OFX_Output to button returned of (display dialog "Would you like to delete the output file now?" buttons {"No", "Yes"} default button "Yes")
if Del_OFX_Output is "Yes" then
delete file (((path to desktop) as string) & Acct_Num & ".ofx")
end if
end tell
end open
on add_leading_zeros(This_Number, Max_Leading_Zeros)
set the Threshold_Number to (10 ^ Max_Leading_Zeros) as integer
if This_Number is less than the Threshold_Number then
set the Leading_Zeros to ""
set the Digit_Count to the length of ((This_Number div 1) as string)
set the Character_Count to (Max_Leading_Zeros + 1) - Digit_Count
repeat Character_Count times
set the Leading_Zeros to (the Leading_Zeros & "0") as string
end repeat
return (Leading_Zeros & (This_Number as text)) as string
else
return This_Number as text
end if
end add_leading_zeros