Daniel Paquin Posted December 26, 2010 Posted December 26, 2010 This script works when executed within AppleScript. However, I am having an error when I try to run it in FileMaker. FileMaker Pro does not let me save it. It signal an error with the Write statement. If I put the write statement a COMMENT "--", I do not have an error. set theEVEclient to {} set theStart to 1 set theEnd to 4 repeat while (theEnd is less than or equal to length of theEVE) set theEVEclient to theEVEclient & (text theStart thru theEnd of theEVE) set theStart to theStart + 5 set theEnd to theEnd + 5 end repeat try set fileRef to open for access file theOrder with write permission write (InvoiceNo & " " & CustomerID & return) to fileRef starting at eof close access fileRef on error try close file theOrder end try end try I also tried the following, and still have an error with the write statement : set theEVEclient to {} set theStart to 1 set theEnd to 4 repeat while (theEnd is less than or equal to length of theEVE) set theEVEclient to theEVEclient & (text theStart thru theEnd of theEVE) set theStart to theStart + 5 set theEnd to theEnd + 5 end repeat try set fileRef to open for access file theOrder with write permission set RecLine to InvoiceNo & " " & CustomerID & return write RecLine to fileRef starting at eof close access fileRef on error try close file theOrder end try end try Does anyone has an idea? Thanks! Daniel
Daniel Paquin Posted December 26, 2010 Author Posted December 26, 2010 In investigating further the problem I've found the following. I have the following script statement set the_text to read file theOrderFile and what is common with both scripts is the word "File". Is this possible that I cannot use the word file in an applescript executed by filemaker pro. If this is the case, what could be a replacement. Thanks! Daniel
comment Posted December 26, 2010 Posted December 26, 2010 I am only guessing here, but IIRC a script executed by Filemaker is by default within a "tell Filemaker" block. Try telling another application to read the file.
Daniel Paquin Posted December 27, 2010 Author Posted December 27, 2010 Many thanks Comment for your help You were right. By adding a statement Tell such as Tell application "Finder" the script executed as required. Regards! Daniel
Recommended Posts
This topic is 5079 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now