• 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 through it's alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Missing dot in the close button
  • Next by Date: Re: Missing dot in the close button
  • Previous by thread: Reading a file through it's alias
  • Next by thread: Missing dot in the close button
  • Index(es):
    • Date
    • Thread