• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Filemaker 8.5 stored applescript problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filemaker 8.5 stored applescript problem


  • Subject: Re: Filemaker 8.5 stored applescript problem
  • From: deivy petrescu <email@hidden>
  • Date: Mon, 14 May 2007 16:48:23 -0400


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
  • Follow-Ups:
    • Re: Filemaker 8.5 stored applescript problem
      • From: James Nierodzik <email@hidden>
References: 
 >Re: Filemaker 8.5 stored applescript problem (From: David Simerly <email@hidden>)
 >Re: Filemaker 8.5 stored applescript problem (From: James Nierodzik <email@hidden>)

  • Prev by Date: Re: Filemaker 8.5 stored applescript problem
  • Next by Date: Listing contents of Spotlight comment fields in folder
  • Previous by thread: Re: Filemaker 8.5 stored applescript problem
  • Next by thread: Re: Filemaker 8.5 stored applescript problem
  • Index(es):
    • Date
    • Thread