• 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
open for access question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

open for access question


  • Subject: open for access question
  • From: Carl Albrecht-Buehler <email@hidden>
  • Date: Fri, 02 May 2003 17:24:20 -0500

Hi again everyone

Sorry to bother you with this, but I'm a little confused about how to
properly access files. Right now I have the following script:

set theFIle to (choose file)
open for access theFile
set fileContents to (read the file from 25 before return)
close access theFile

This works for me, but now I would like to hard code a path name instead of
using "choose file". I've tried a number of different iterations in order
to try to get a specific file to open with 'open for access' and I always
get errors:

if i open for access ((path to startup disk as Unicode text) &
"Folder:Subfolder:Text.txt" I get a Duplicate file name error

if I set theFile to ((path to startup disk as Unicode text) &
"Folder:Subfolder:Text.txt"

if I set theFile to "startup disk:Folder:Subfolder:Text.txt" I get a 'File
wasn't found error with the open for access highlighted.

Can someone please enlighten me to the correct procedure to get a specific
file from a hard code path and then open it for access?

Thanks,

Carl
_______________________________________________
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: open for access question
      • From: Michelle Steiner <email@hidden>
    • Re: open for access question
      • From: Andrew Oliver <email@hidden>
References: 
 >Re: Rules for leading colon (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: When a string is not a string for Palm Desktop
  • Next by Date: Re: mac to unix path names
  • Previous by thread: Re: Rules for leading colon
  • Next by thread: Re: open for access question
  • Index(es):
    • Date
    • Thread