• 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: read write basics
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read write basics


  • Subject: Re: read write basics
  • From: Guy Parker <email@hidden>
  • Date: Thu, 05 Jul 2001 11:47:53 +0100

Looks to me like you just need to use the "open for access" command...

open for access file "myhd:desktop folder:new source" with write permission
copy (choose file) to _source
read _source as list using delimiter space
write result to file "myhd:desktop folder:new source"
close access file "myhd:desktop folder:new source"

"Open for access" will create the specified file if it doesn't already
exist.

You might also find this useful later:

set DesktopPath to path to desktop as string
open for access file (DesktopPath & "new source") with write permission


Guy




> hi list
>
> at a loss as to how to write a text file, just trying to get my i/o
> framework going on a newbie script i'm throwing together
>
> here's what i have so far, and i always end up with an 'execution error'
> that the file i'm trying to write "wasn't found"
>
> i expect there is some command that i need prior to writing the file, and
> when i try 'create file . . . ' i get a 'syntax error' 'expected end of
> line, etc. but found class name' (so it's a bad command i suppose), anyway:
>
> copy (choose file) to _source
>
> read _source as list using delimiter space
>
> write result to file "myhd:desktop folder:new source"
>
> thanks,


  • Follow-Ups:
    • Re: read write basics
      • From: monk <email@hidden>
  • Prev by Date: Re: GREP in Akua's "the entries in"
  • Next by Date: properties, globals in folder actions
  • Previous by thread: read write basics
  • Next by thread: Re: read write basics
  • Index(es):
    • Date
    • Thread