• 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: puzzled with script syntax error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: puzzled with script syntax error


  • Subject: Re: puzzled with script syntax error
  • From: John Stewart <email@hidden>
  • Date: Wed, 26 Jun 2002 17:07:02 -0400

On 6/26/02 at 12:39 PM, the entity Lui spoke thusly

>I am puzzled at what's going on...
>
>I am trying to read a file from disk and put its
>content into a FileMaker Pro database. But I get an
>error on the syntex and have no idea what is wrong.
>Please help!
>
>Chunk of Script:
>
>set fileRef to alias "Macintosh HD:
>Users:sharon:file1.txt"
>open for access fileRef
>set _result to (read fileRef)
>close access fileRef
>
>When trying to save the script in FileMaker's 'Specify
>Applescript' window, I get error:
>'Expected ", " but found ideentifier. (Error -2741).'
>with the word 'fileRef' in '(read fileRef)'
>highlighted.
>
>Thanks in advance,
>Sharon



set filePath to alias "Macintosh HD: Users:sharon:file1.txt"
set fileRef to open for access filePath
set theResult to (read fileRef)
close access fileRef


However this oneliner will work just as well if all you need to do is read the file into a variable-

set theResult to (read alias "Macintosh HD: Users:sharon:file1.txt")

John
_______________________________________________
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.

References: 
 >puzzled with script syntax error (From: Lui <email@hidden>)

  • Prev by Date: puzzled with script syntax error
  • Next by Date: Re: What's the easy way to do this?
  • Previous by thread: puzzled with script syntax error
  • Next by thread: Re: puzzled with script syntax error
  • Index(es):
    • Date
    • Thread