Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

AppleScript compiles in AppleScript Editor but not in Filemaker


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

Recommended Posts

Posted

Hello, I am trying to write an AppleScript script that takes the contents of my clipboard and creates a text(.txt) document from it. I have tried using the built in "Save a Copy As" filemaker script step but it converts the text document into some type of Unicode format that the Python script I am running the .txt document on doesn't recognize. So I have written an AppleScript script which compiles and runs correctly when run from the AppleScript Editor but gives an error message if I try to compile it within the "Perform AppleScript" Script step in FileMaker. Here is the AppleScript:

set theText to (get the clipboard as text)

set theFile to (open for access file (("Users:georgeorton:Documents:") & "nlpexportfile.txt") with write permission)

set eof theFile to 0 -- reset file contents (if any)

write theText to theFile

close access theFile

This script runs correctly from the AppleScript editor but gives the following error message if compiled within FileMaker:

Expected end of line, etc. but found identifier.

with the "theText" portion of the "write theText to theFile" line highlighted.

Does anybody have any idea how to solve this problem? Sincerely, George

Posted

Hi, Thanks for the link but unfortunately it didn't work. I tried putting my AppleScript script in a "Tell application "Finder"" block but instead of compiling it opened the AppleScript Dictionary and then locked up my system. Thanks, George

Posted

Hello, I am trying to write an AppleScript script that takes the contents of my clipboard and creates a text(.txt) document from it. I have tried using the built in "Save a Copy As" filemaker script step

Save a copy as is for saving a copy of your Filemaker file.

This topic is 5013 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
×
×
  • Create New...

Important Information

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