Re: reading a file in an applescript.
Re: reading a file in an applescript.
- Subject: Re: reading a file in an applescript.
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 21 Mar 2008 16:31:46 -0400
I think you must have a syntax error earlier in your script or
something. This works for me, at least saved as text and run via
osascript; it cats the contents of the file "repl.txt" in the same
folder as the script:
set replyTemplateName to "repl.txt"
set myPath to (path to me)
tell application "Finder" to set myFolder to (container of myPath) as text
set targetFile to myFolder & replyTemplateName
set readHandle to open for access targetFile
set fileText to read readHandle for get eof readHandle
close access readHandle
fileText
--
Mark J. Reed <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