• 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: How write to a file in an invisible folder ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How write to a file in an invisible folder ?


  • Subject: Re: How write to a file in an invisible folder ?
  • From: email@hidden
  • Date: Mon, 20 Sep 2004 10:35:25 -0400

Trying to write/create a file in an invisible folder like this, problem is that since the folder is invisible it seems like the folder can be found.... and then not written to...

I noticed you use 'thefile' in place of 'fref' in 'write (tsize) to thefile'. This may be where your problem is.


View and try the following code -

do shell script ("mkdir /.ticker") -- Create invisible folder titled '.ticker'.

set fileToCreate to "/.ticker/TestFile.txt"
do shell script ("touch " & fileToCreate)

set filePath to POSIX path of file fileToCreate -- Convert UNIX path to Mac path format.

-- 'open' the file and assign 'fileRef' as file's reference.
set fileRef to open for access filePath with write permission

set theString to "1 2 3 4 5 6 7 8 9 10" -- Text to place into 'TestFile.txt'.
write theString to fileRef -- 'write' the text in theString to 'fileRef'.
close fileRef -- 'close' the file via 'fileRef'.

do shell script "more " & fileToCreate -- View the just created file.

--

SJWL
_______________________________________________
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


  • Follow-Ups:
    • Re: How write to a file in an invisible folder ?
      • From: Malcolm Fitzgerald <email@hidden>
  • Prev by Date: Re: A couple of problems...
  • Next by Date: Re: A couple of problems...
  • Previous by thread: How write to a file in an invisible folder ?
  • Next by thread: Re: How write to a file in an invisible folder ?
  • Index(es):
    • Date
    • Thread