• 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: Writing To A File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing To A File


  • Subject: Re: Writing To A File
  • From: Steve Mills <email@hidden>
  • Date: Tue, 30 Sep 2003 08:20:19 -0500

On Monday, Sep 29, 2003, at 23:08 US/Central, Richard Morton wrote:

Yep. As Paul B pointed out, 'open for access' has nothing to do with the Finder. These commands are part of the Standard Additions osax.

Yes, I know it's a standard addition. I was illustrating what not to do. As for how bulletproof these commands are, I disagree. Run this twice:

tell application "Finder"
set rn to open for access "Gort:Users:sjmills:Desktop:testblah" with write permission
write "bob" to rn
close access rn
end tell

One the 2nd run, I get "Finder got an error: Duplicate file name. some object". Take out the Finder targeting and I get "Duplicate file name. Gort:Users:sjmills:Desktop:testblah".

Now add the class "file" before the pathname and it works. Clearly, it's a bug that it doesn't work a 2nd time if you pass a pathname string. THIS is the problem I always have, and it's not obvious that I have to remember to type "file" in front of it, because almost every other app or command I regularly use that takes a file reference works no matter what when I pass a pathname string instead of a file or alias. If other apps and commands are written to be smart enough to always accept a string, then these commands should be too.

And man, you'd think that after all these years of being on various Apple-run mailing lists, I'd remember that they don't put a reply-to in their messages. I HATE that. Lots of people complain about it, but they still won't change it. I've never seen any problems from having the reply-to field filled in on other mailing lists. I get really sick of my messages going to the person who posted the message instead of back to the list where they *should* go, forcing me to send it again to the correct address. That's why it's a mailing *list*, so *everybody* sees the messages and replies.

Yeah, I'm cranky this morning because the new idiot that delivers the stupid newspaper in the neighborhood has an old Prelude with a euro-racer-geek-boy muffler which wakes me up far too early.

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
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: Writing To A File
      • From: Deivy Petrescu <email@hidden>
    • Re: Writing To A File
      • From: Paul Berkowitz <email@hidden>
    • Re: Writing To A File
      • From: Paul Skinner <email@hidden>
References: 
 >Re: Writing To A File (From: Richard Morton <email@hidden>)

  • Prev by Date: Re: "starts with" any list item
  • Next by Date: Re: Writing To A File
  • Previous by thread: Re: Writing To A File
  • Next by thread: Re: Writing To A File
  • Index(es):
    • Date
    • Thread