May 13, 201213 yr I'm trying to add a header to my bank statement to import it into Filemaker properly, but my script overwrites the first four characters before adding the desired text. I'm quite green with Applescript, and I can't see my mistake. Any help would be appreciated. Here's the beginning of the file before the script (date, amount, transaction type, transaction detail) is run 4/30/12,-63.00,000000399,"Cheque","" and after: ,,, /12,-63.00,000000399,"Cheque","" I wanted to add the ",,, " What's happened to "4/30" ? Here's my script: tell application "Finder" open for access "Macintosh HD:Users:johnnolan:Documents:RandB database FM12:Statements:Exported from containers:temp_statement.csv" with write permission write ",,," & return to file "Macintosh HD:Users:johnnolan:Documents:RandB database FM12:Statements:Exported from containers:temp_statement.csv" close access file "Macintosh HD:Users:johnnolan:Documents:RandB database FM12:Statements:Exported from containers:temp_statement.csv" end tell
May 14, 201213 yr Not directly related to your question, but why is it necessary "to add a header to my bank statement to import it into Filemaker properly"? If you know in advance the order of the columns, why not simply import the file using a script?
May 14, 201213 yr Author I am importing with a script, but I can't get the first record in; the file just starts with data on the first line; I get the second and subsequent records imported, but not the first. Is there some other way around this?
May 14, 201213 yr You don't need to use Applescript at all in filemaker you create a youur script step there is a dialog or checkbox on the import script step that asks if you wish to import the first row as column headers or treat it as DATA you will wish to select the second option and you will result in importing all your data.
May 14, 201213 yr Author Duh! I had inadvertently set the file type to merge in my first attempt with the script, and after that missed the option... there's a few hours I'll never get back. Thanks!
Create an account or sign in to comment