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.

Applescript works in Applescript but won't run in FM 8

Featured Replies

Hey There -

I have an apple script:

set TextOfFile to read choose file with prompt "Choose file to import."

Set file_path to "(I have a FilePath here)"

open for access file file_path with write permission

write TextOfFile to file file_path

close access file file_path

It works perfectly when I run it through the Applescript editor, but in FM, after I enter it as a native Applescript, it says:

Expected End of line, etc. but found identifier.

and then it highlights TextofFile in the "Write" line.

Help?

I attempted to create a calculated applescript too, but when I ran the FM script, the same message popped up.

Thanks in advance!

Put it all inside:

tell application "Finder"

blah blah

end tell

FileMaker doesn't like the "write" command. Not sure why.

  • Author

Awesome! Thanks so much : It worked.

I wonder why Filemaker doesn't like the write script.

I ended up changing my applescript a bit because I was having some permissions issues with the location where the text file was being created.

I just learned that an applescript from Filemaker does not need the "Tell Application "Filemaker Pro" block, so I just have

Tell Database "DatabaseName"

set field "fieldname" of current record to TextOfFile

end tell

This is great because we are running a multi-user database, with some on FM Pro 8, FM Pro 8 Advanced, and even an FM Pro 7. and the applescript would get hung up on the "Tell application "Filemaker Pro" unless I had a calculated applescript which specified which version of Filemaker the user was on.

Anywho, after all that, thank you, Fenton!!

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.