Jump to content

Write statement in error


Daniel Paquin
 Share

This topic is 4424 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 4424 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.