Re: AppleScript Read file in Filemaker
Re: AppleScript Read file in Filemaker
- Subject: Re: AppleScript Read file in Filemaker
- From: Jim Marschke <email@hidden>
- Date: Wed, 18 Feb 2004 06:48:17 -0800
I'll admit that the way I dealt with EOF in this particular script was
clunky, but the real problem is that it will no longer compile and run
in Filemaker -- when it did before.
If I run the [perform Applescript] script step on a calculated field I
get the error. If I paste the script into the script step as script
text, Filemaker complies it when I click the OK button and immediately
reports the same error. It also hi-lights whatever comes immediately
after the read command (in this case the word "file").
I'm thinking something is wrong with the syntax of the line:
set theData to (read file theFIle from filePos to filePos + 30000)
I am hoping it can be improved or worked around.
BTW, I've messed around with file specifications etc. thinking that
might be it, but no matter what I try the problem appears to be with
the use of the "read" command from the AppleScript standard additions.
Jim
Hello Jim,
Here's what I think is happening:
The script repeats while filePos is less than EOF, but in the read
file command
you read from filePos to filePos + 30000.
You have to check if (filePos + 30000) is less than EOF.
Hanaan
I have an AppleScript which I run from within FileMaker using the
[perform Applescript] script step. This script reads data from a text
file in chunks so my database can process it. The data file comes
from
a piece of lab equipment that outputs a text file that is gibberish --
no delimiters or intelligent formatting -- which is why I need to
parse
it. I have considered switching to a plug-in, but I have many users
and don't want to hassle with the licensing issues.
I'm running FileMaker 6 on MacOSX - Panther.
This script used to work, but something has changed and I now get
errors (maybe Panther?). It does work fine if I run it in the
AppleScript Script Editor, but from within FileMaker I get the error.
Here's part of the script:
repeat while filePos < (get eof file theFIle)
set theData to (read file theFIle from filePos to filePos + 30000)
tell application "FileMaker Developer"
set data cell "Data_g" of current record to theData as string
end tell
-- then run my script to process the data
end repeat
close access
The error is: Expected "," but found identifier. (Error - 2741).
FileMaker appears to be gagging on the "read file" in line two of the
code.
Any ideas?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/
applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.