Re: Reading a file through it's alias
Re: Reading a file through it's alias
- Subject: Re: Reading a file through it's alias
- From: kai <email@hidden>
- Date: Tue, 7 Dec 2004 05:22:46 +0000
On Tue, 7 Dec 2004 04:26:20 +0100, Ferenc Farkas MÁTYÁS wrote:
Has anyone good experiences regarding reading files through a
command+L alias reference? The cat does not work well, only if I read
the original file, not the alias.
open for access file "System:Users:ffmatyas:projects:server
tech:server tech log.txt" with write permission
--> 183
get eof 183
--> 25.0
read 183 from 1 to 25.0 as «class utf8»
--> "
2004/12/06 15:24:48 log
"
close access 183
If a path points to an alias file, then could get its original item
something like this:
----------------------
set f to "Macintosh HD:path:to:some:alias file"
tell application "Finder" to set f to file f's original item as alias
set o to open for access f with write permission
set t to read o as «class utf8»
close access o
----------------------
The file spec is ok, although the eof is bad, and so is the readed
data. The script finished the open for access close access sentences,
but TextEdit still complains that it can not open the alias file in
the Finder with double-click. And the issue is he same, when an alias
is a directory. I use the latest 10.3.6.
The eof for an alias file is 0.0, which is why pointing to the original
item is necessary. Once that's done (as shown above), you should also
be able to say:
----------------------
tell application "TextEdit" to open f
----------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden