• 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: Cornwall <email@hidden>
  • Date: Wed, 26 Jun 2002 16:18:08 -0700

At 12:39 PM -0700 6/26/02, Lui wrote:

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

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

This is a FileMaker bug that has been around since FMP 4.0 (and is
still here in 5.5). You didn't say but you're trying to embed his in
a FileMaker script, right?

I think you have only two choices, and #1 is the better choice.

1. Use raw events for the read - write commands

set fileRef to alias "Macintosh HD:Users:sharon:file1.txt"
--open for access fileRef
set _result to <<event rdwrread>> fileRef
--close access fileRef

2. Enclose "set _result to (read fileRef)" in a Finder tell

set fileRef to alias "Macintosh HD:Users:sharon:file1.txt"
--open for access fileRef
tell app "Finder"
set _result to (read fileRef)
end tell
--close access fileRef

-- "<<" and ">>" are chevrons (ASCII 199 and 200).

Corny
_______________________________________________
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: Re: AppleScript 1.8.3 breaks recording in MailSmith?
  • Next by Date: Re: puzzled with script syntax error
  • Previous by thread: Re: puzzled with script syntax error
  • Next by thread: Re: puzzled with script syntax error
  • Index(es):
    • Date
    • Thread