Re: Filemaker 8.5 stored applescript problem
Re: Filemaker 8.5 stored applescript problem
- Subject: Re: Filemaker 8.5 stored applescript problem
- From: James Nierodzik <email@hidden>
- Date: Mon, 14 May 2007 16:03:46 -0500
Like you guessed you *can* read it actually, but it can choke the
script up, but anything under a few megs and you should be fine.
On May 14, 2007, at 3:48 PM, deivy petrescu wrote:
On May 14, 2007, at 16:23, James Nierodzik wrote:
Actually the portion about opening for access is quite untrue. If
you only intend to read from a file there is no need to read from
it unless it is very very large.
James,
where did you get this information? I've never heard that you can
not read it if it is very large.
Unless you mean that reading it by bits will not choke the script.
Either of these work just fine...
set deskPath to path to desktop as Unicode text
set filePath to deskPath & "test file.txt"
set fileData to read file filePath
--
set filePath to "/Path/To/Desktop/test file.txt"
set fileData to read POSIX file filePath
~
James Nierodzik
Actually, you also do not need permission to write to a file.
Just do it!
On May 14, 2007, at 1:52 PM, David Simerly wrote:
On 5/13/07 7:37 PM, "Malcolm Fitzgerald"
<email@hidden> wrote:
You are seeing a terminology conflict. Filemaker provides it's own
definition of READ and WRITE. You are trying to call standard
additions
"read" command aren't you. The simplest, most unambiguous way to
get
around the terminology conflict is to use raw codes.
Um no, I don’t think so. Try searching for the terminology “read”
or “write” in FM’s dictionary and you’re not going to find
anything. There are no read/write commands listed in the
AppleEvents Reference database either. The reason the code is
choking at the read is because one cannot pass a file reference
or an alias directly to the read command. You must first
initialize a file point with “open for access,” and then pass the
file pointer to read, like so:
set file_prt to open for access the path
set file_data to read file_ptr until eof
close file_ptr
HTH.
Best,
Dave
Deivy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden