Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Write statement in error

Featured Replies

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

  • Author

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

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.

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.