• 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: reading a file in an applescript.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading a file in an applescript.


  • Subject: Re: reading a file in an applescript.
  • From: Doug Meade <email@hidden>
  • Date: Thu, 27 Mar 2008 10:49:56 -0400
  • Thread-topic: reading a file in an applescript.

Title: Re: reading a file in an applescript.
Firstly thanks to everyone for the many helpful tips.
Not sure why none of them work so well.
I’m going to be upgrading to leopard today I think – maybe that will help.

Anyway I got the compile error to stop...
I had to add an ,

So I changed
 set fileText to {read readHandle}
To
 set fileText to {read, readHandle}

But now when I try to display the content of the file that was read I get an error.
(this time it’s a run time error)

The error  is:
Microsoft Entourage got an error: Can't make {read, 1143} into type string.

I’ve tried the following 3 methods of displaying the text from the file:

  • display alert fileText
  • display dialog fileText
  • fileText



Thanks!
Doug



From: Doug Meade <email@hidden>
Date: Fri, 21 Mar 2008 15:35:33 -0400
To: <email@hidden>
Conversation: reading a file in an applescript.
Subject: reading a file in an applescript.

Hi folks!
New to applescript ...
I'm trying to read a file in an applescript.

I've tried a number of different syntax options.
The most simple is:

read theTextFile

I get the following error:
Expected end of line, etc. but found identifier.

But this is the most basic syntax I've found.
Any ideas?

(I’m running OSX – not leppord)



_______________________________________________
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
 _______________________________________________
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: reading a file in an applescript.
      • From: "Mark J. Reed" <email@hidden>
    • Re: reading a file in an applescript.
      • From: Doug Meade <email@hidden>
References: 
 >reading a file in an applescript. (From: Doug Meade <email@hidden>)

  • Prev by Date: Focus message window
  • Next by Date: Re: reading a file in an applescript.
  • Previous by thread: Re: reading a file in an applescript.
  • Next by thread: Re: reading a file in an applescript.
  • Index(es):
    • Date
    • Thread