• 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
'Expected "end" but found "end tell"'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'Expected "end" but found "end tell"'


  • Subject: 'Expected "end" but found "end tell"'
  • From: Chap Harrison <email@hidden>
  • Date: Wed, 21 Jan 2004 22:21:46 -0600

Weird syntax error - and weird way to get around it. Should I be coding this differently?

In the attached snippet, the second-to-last line (end tell) is flagged with the error 'Expected "end" but found "end tell"'. I finally found that the way to fix it was to delete the word 'transaction' from the preceding line. Upon subsequently saving or running, AS silently appends the word 'transaction' where I had just deleted it, and all is well... until I make another modification to the script, at which time we repeat the whole exercise.

Thanks, Chap

- - - - -

repeat
try
set dataList to (read fid before gRecordSeparator using delimiter gFieldSeparator)

on error -- reading EOF drives this block - hopefully we never get a real error!
close access fid
exit repeat

end try

set msgID to item 1 in dataList

set myIndex to 1
tell application "FileMaker Pro"
set iExist to true
try
find msgID in cell "MessageID" of database gWebOrders
on error
set iExist to false
end try
if (iExist) then
display dialog "" & msgID & "already exists."
exit repeat
end if
-- create new record here ...
with transaction
set current record to (create record at end of database gWebOrders)
tell current record
-- add all fields
repeat with myFieldName in WOFieldList
set myValue to (item myIndex in dataList)
set cell (myFieldName as string) to myValue
set myIndex to myIndex + 1
end repeat
end tell
end transaction
end tell -- <== 'Expected "end" but found "end tell"'
end repeat
_______________________________________________
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.
  • Follow-Ups:
    • Re: 'Expected "end" but found "end tell"'
      • From: Mark Douma <email@hidden>
    • Re: 'Expected "end" but found "end tell"'
      • From: Michelle Steiner <email@hidden>
    • Re: 'Expected "end" but found "end tell"'
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: applescript and browsers
  • Next by Date: Re: applescript and browsers
  • Previous by thread: Re: Retrieving Entourage tasks and events that have been modified after a given date
  • Next by thread: Re: 'Expected "end" but found "end tell"'
  • Index(es):
    • Date
    • Thread