Re: How write to a file in an invisible folder ?
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