• 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: Strange Error Reading File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange Error Reading File


  • Subject: Re: Strange Error Reading File
  • From: Richard Morton <email@hidden>
  • Date: Wed, 7 Apr 2004 10:26:55 +1000

On 7 Apr 2004, at 1:24 AM, David Crowe wrote:
"AFile" was passed to the function as a string. I've changed the function call to pass it as the alias instead of casting it to string.

If that doesn't work I'll try using the keyword "file" in front of the value as string.

(my gut instinct is that it's always better to remove words from a program than add them!)

The only problem with that is that it makes the code harder to re-use. If you're creating a new file you won't be able to pass an alias so under different circumstances you will need a slightly different version of the same code. Well worth avoiding I think.

Passing around strings and coercing to a file object within the handler will always work and is flexible. The file object, as opposed to alias or path string, is the documented usage.


If someone can explain why "open for access X" sometimes works when "X" is a string, and sometimes gives an error (a misleading error at that), I would appreciate it!

It's a bug.

Cheers,

K Ritter
_______________________________________________
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.


References: 
 >Re: Strange Error Reading File (From: David Crowe <email@hidden>)

  • Prev by Date: Re: Return of the Dummy(ies)
  • Next by Date: Re: Entourage - send mail & attach on-the-fly
  • Previous by thread: Re: Strange Error Reading File
  • Next by thread: A Faster Script
  • Index(es):
    • Date
    • Thread